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 [4]:
x = np.random.randn(100)
y = 2.4 * x + 1.3 + np.random.randn(100)
plt.scatter(x, y)
plt.xlabel("x")
plt.ylabel("y")
plt.title("y vs. x")
Out[4]:
Learn how to use Matplotlib's plt.hist function to make a 1d histogram.
np.random.randn.
In [5]:
z = np.random.randn(10000)
plt.hist(z)
plt.xlabel("z")
plt.ylabel("Frequency")
plt.title("Histogram of z")
Out[5]: