In [2]:
%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 [28]:
z=np.random.randn(2,10)
x=z[0,:]
x
y=z[1.:]
y
plt.scatter(x, y, s=60)
plt.xlabel('x')
plt.ylabel('y')
plt.title('y vs x')
plt.tight_layout()
plt.grid(True)
plt.yticks([-4,-2,0,2,4], [-4,-2,0,2,4])
plt.ylim(-5, 5)
Out[28]:
Learn how to use Matplotlib's plt.hist function to make a 1d histogram.
np.random.randn.
In [48]:
f=np.random.randn(10)
plt.hist(f, bins=3, color='r')
plt.xlabel('x')
plt.ylabel('y')
plt.tick_params(length=0)
plt.title('y vs x')
Out[48]:
In [ ]: