In [31]:
%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 [15]:
datax = np.random.randn(10,5)
datay = np.random.randn(10,5)
In [29]:
fig = plt.figure(figsize=(8,5))
plt.scatter(datax, datay, marker = '.', alpha = 1, color = 'r')
plt.tick_params(top=False, right=False)
plt.title('Random Number Scatter Plot')
plt.xlabel('x')
plt.ylabel('y')
Out[29]:
Learn how to use Matplotlib's plt.hist function to make a 1d histogram.
np.random.randn.
In [32]:
data = np.random.randn(10,5)
In [71]:
fig = plt.figure(figsize=(8,5))
plt.hist(data, bins = 5, histtype = 'bar', align = 'mid', range = (-3,2))
plt.tick_params(top=False, right=False)
plt.title('Random Number Histogram')
plt.xlabel('x')
plt.ylabel('y')
plt.xticks([-3,-2.5,-2,-1.5,-1,-.5,0,.5,1,1.5,2])
Out[71]:
In [ ]: