In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
Learn how to use Matplotlib's plt.scatter function to make a 2d scatter plot.
np.random.randn.
In [41]:
scatx=np.random.rand(50)
scaty=np.random.randn(50)
f= plt.figure(figsize=(9,6))
plt.scatter(scatx,scaty,c=u'k',marker=u'o',alpha=1)
plt.xlabel('X')
plt.ylabel('Y')
plt.title("Scatter Plot of A Set of Random Data")
Out[41]:
Learn how to use Matplotlib's plt.hist function to make a 1d histogram.
np.random.randn.
In [35]:
x= np.random.rand(50)
plt.hist(x)
plt.xlabel("X")
plt.ylabel("Y")
plt.title("One Dimensional Histogram of a Random Set of Data")
plt.hist(x,bins=50, normed=True, facecolor="r",stacked=False)
Out[35]:
In [ ]:
In [ ]: