In [48]:
%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 [65]:
x = np.random.randn(100)
y = np.random.randn(100)
plt.scatter(x,y, s = 20, c = 'b')
plt.xlabel('Random Number 2')
plt.ylabel('Random Number')
plt.title('Random 2d Scatter Plot')
axis = plt.gca()
axis.spines['top'].set_visible(False)
axis.spines['right'].set_visible(False)
axis.get_xaxis().tick_bottom()
axis.get_yaxis().tick_left()
plt.tight_layout()
Learn how to use Matplotlib's plt.hist
function to make a 1d histogram.
np.random.randn
.
In [66]:
x = np.random.randn(10)
plt.hist(x,4)
plt.xlabel('X value')
plt.ylabel('Y value')
plt.title('Random Histogram Bins')
Out[66]:
In [ ]: