In [1]:
%matplotlib inline

In [2]:
import matplotlib.pyplot as plt

In [3]:
from sklearn.datasets import make_regression

In [35]:
X, y = make_regression(100, 2, noise=10)

In [36]:
X[:5]


Out[36]:
array([[ -1.29013893e-03,   6.39742275e-01],
       [  4.21689308e-01,   6.89509243e-01],
       [ -3.16373597e-01,   2.74230167e+00],
       [  2.52988315e-01,   3.05501915e-01],
       [ -6.72789906e-03,  -2.98754137e-01]])

In [37]:
f, ax = plt.subplots(figsize=(7,5))
f.tight_layout()
ax.scatter(X[:, 0], X[:, 1], color='r', label='random values')
ax.set_title('random values')
ax.legend(loc='best')


Out[37]:
<matplotlib.legend.Legend at 0x10eac5a90>

In [ ]: