<jupyter_start><jupyter_text>New to Plotly?Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).You can set up Plotly to work in [online](https://plot.ly/python/getting-started/initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/start-plotting-online).We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!  Version CheckNote: Scatterplot Matrix is available in version 1.9.11+Run  `pip install plotly --upgrade` to update your Plotly version<jupyter_code>import plotly
plotly.__version__<jupyter_output><empty_output><jupyter_text>Basic Scatterplot Matrix<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(10, 2),
                         columns=['Column A', 'Column B'])

fig = ff.create_scatterplotmatrix(dataframe, height=800, width=800)
py.iplot(fig, filename='Basic Scatterplot Matrix')<jupyter_output><empty_output><jupyter_text>Index a Column<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(10, 2),
                         columns=['Column A', 'Column B'])

dataframe['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple',
                                'grape', 'pear', 'pear', 'apple', 'pear'])

fig = ff.create_scatterplotmatrix(dataframe, index='Fruit', size=10, height=800, width=800)
py.iplot(fig, filename = 'Index a Column')<jupyter_output><empty_output><jupyter_text>Box Plots along Diagonal<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(10, 4),
                         columns=['Column A', 'Column B', 'Column C', 'Column D'])

dataframe['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple',
                                'grape', 'pear', 'pear', 'apple', 'pear'])


fig = ff.create_scatterplotmatrix(dataframe, diag='box', index='Fruit',
                                  height=800, width=800)
py.iplot(fig, filename='Box plots along Diagonal Subplots')<jupyter_output><empty_output><jupyter_text>Histograms along Diagonal<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(20, 4),
                         columns=['Column A', 'Column B', 'Column C', 'Column D'])

dataframe['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple',
                                'grape', 'pear', 'pear', 'apple', 'pear',
                                'apple', 'apple', 'grape', 'apple', 'apple',
                                'grape', 'pear', 'pear', 'apple', 'pear'])


fig = ff.create_scatterplotmatrix(dataframe, diag='histogram', index='Fruit',
                                  height=800, width=800)
py.iplot(fig, filename='Histograms along Diagonal Subplots')<jupyter_output><empty_output><jupyter_text>Sequential Colormap<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(100, 3),
                         columns=['Column A', 'Column B', 'Column C'])

fig = ff.create_scatterplotmatrix(dataframe, diag='histogram',index='Column A',
                                  colormap='Blues', height=800, width=800)
py.iplot(fig, filename = 'Use a Sequential Colormap')<jupyter_output><empty_output><jupyter_text>Custom Sequential Colormap<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as ff

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(100, 3),
                         columns=['Column A', 'Column B', 'Column C'])

fig = ff.create_scatterplotmatrix(dataframe, diag='histogram', index='Column A',
                                  colormap=['rgb(100, 150, 255)', '#F0963C', 'rgb(51, 255, 153)'],
                                  colormap_type='seq', height=800, width=800)
py.iplot(fig, filename = 'Custom Sequential Colormap')<jupyter_output><empty_output><jupyter_text>Partition Numeric Data into Intervals<jupyter_code>import plotly.plotly as py
import plotly.figure_factory as FF

import numpy as np
import pandas as pd

dataframe = pd.DataFrame(np.random.randn(100, 3),
                         columns=['Column A', 'Column B', 'Column C'])

fig = FF.create_scatterplotmatrix(dataframe, diag='box', index='Column A',
                                  colormap='Portland', colormap_type='seq',
                                  endpts=[-1, 0, 1],
                                  height=800, width=800, size=12,
                                  marker=dict(symbol=25))
py.iplot(fig, filename = 'Partition Numeric Data into Intervals')<jupyter_output><empty_output><jupyter_text>Categorical Colormap<jupyter_code>import plotly.plotly as py
import plotly.graph_objs as go
import plotly.figure_factory as ff

import numpy as np
import pandas as pd
import random

dataframe = pd.DataFrame(np.random.randn(100, 2),
                         columns=['Column A', 'Column B'])

new_column = []
fruits = ['apple', 'blueberry', 'banana', 'orange', 'raspberry']
for j in range(100):
    new_column.append(random.choice(fruits))
dataframe['Fruits'] = pd.Series(new_column, index=dataframe.index)

fig = ff.create_scatterplotmatrix(dataframe, index='Fruits', diag='histogram',
                                  colormap= ['#d95f0e', (0.2, 0.6, 1), 'rgb(230,247,188)', '#bcbddc', (0.8, 0.7, 0.65)],
                                  colormap_type='cat',
                                  height=800, width=800,
                                  size=15, marker=dict(symbol='square-open'))
py.iplot(fig, filename = 'Use a Categorical Colormap')<jupyter_output><empty_output><jupyter_text>Colormap as a Dictionary<jupyter_code>import plotly.plotly as py
import plotly.graph_objs as go
import plotly.figure_factory as ff

import numpy as np
import pandas as pd
import random

dataframe = pd.DataFrame(np.random.randn(100, 3),
                  columns=['Column A', 'Column B', 'Column C'])

new_column = []
strange_colors = ['turquoise', 'limegreen', 'goldenrod']
for j in range(100):
    new_column.append(random.choice(strange_colors))
dataframe['Colors'] = pd.Series(new_column, index=dataframe.index)

fig = ff.create_scatterplotmatrix(dataframe, diag='box', index='Colors',
                                  colormap= dict(
                                      turquoise = '#00F5FF',
                                      limegreen = '#32CD32',
                                      goldenrod = '#DAA520'
                                  ),
                                  colormap_type='cat',
                                  height=800, width=800)
py.iplot(fig, filename = 'Colormap as a Dictionary')<jupyter_output><empty_output><jupyter_text>Reference<jupyter_code>help(ff.create_scatterplotmatrix)
from IPython.display import display, HTML

display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700rel="stylesheet" type="text/css" />'))
display(HTML('<link rel="stylesheet" type="text/csshref="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))

! pip install git+https://github.com/plotly/publisher.git --upgrade
import publisher
publisher.publish(
    'scatterplot-matrix.ipynb', 'python/legacy/scatterplot-matrix/', 'Scatterplot Matrix',
    'How to make scatterplot-matrix plots in Python with Plotly.',
    title = 'Python Scatterplot Matrix | plotly',
    name = 'Scatterplot Matrix',
    has_thumbnail='true', thumbnail='thumbnail/scatterplot-matrix.jpg',
    language='python', display_as='legacy_charts', order=10.1,
    ipynb= '~notebook_demo/27')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13079450054751185, 'fraction_numerical': 0.02250882102445553, 'mean_word_length': 3.2262210796915167, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '515211', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 2778, 'n_tokens_neox': 2553, 'n_words': 571, 'path': '_posts/python-v3/legacy/scatterplot-matrix/scatterplot-matrix.ipynb', 'repo_name': 'bmb804/documentation', 'size': '8219'}