# 如何创建切片的CSV文件的散点图矩阵？

``````  File "college.py", line 12, in <module>
pd.plotting.scatter_matrix(data1)
File "/Users//Library/Python/3.7/lib/python/site-packages/pandas/plotting/_misc.py", line 134, in scatter_matrix
**kwargs,
File "/Users//Library/Python/3.7/lib/python/site-packages/pandas/plotting/_matplotlib/misc.py", line 30, in scatter_matrix
fig, axes = _subplots(naxes=naxes, figsize=figsize, ax=ax, squeeze=False)
File "/Users//Library/Python/3.7/lib/python/site-packages/pandas/plotting/_matplotlib/tools.py", line 231, in _subplots
ax0 = fig.add_subplot(nrows, ncols, 1, **subplot_kw)
File "/Users//Library/Python/3.7/lib/python/site-packages/matplotlib/figure.py", line 1414, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
File "/Users//Library/Python/3.7/lib/python/site-packages/matplotlib/axes/_subplots.py", line 59, in __init__
f"num must be 1 <= num <= {rows*cols}, not {num}")
ValueError: num must be 1 <= num <= 0, not 1
``````
``````import matplotlib.pyplot as plt
import pandas as pd

data = pd.read_csv('college.csv', index_col = 0)

# Summarize Dataset
print(data.describe())

# Plot first 10 columns into scatterplot matrix
data1 = data.iloc[0:10]
pd.plotting.scatter_matrix(data1)```
``````

``````data1.plot(kind='scatter',x='x_var',y='y_var')
``````