%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,10)
y = np.arange(0,10)
plt.plot(x,y)
There are some great defaults to make these plots pretty!
print plt.style.available
plt.style.use('fivethirtyeight')
plt.plot(x,y)
plt.style.use('ggplot')
plt.plot(x,y)
x = np.arange(-10,10)
a = np.arange(0,20)
b = [b**2 for b in range(0,20)]
c = [100 for c in range(0,20)]
plt.title("Some Squiggles")
plt.plot(x,a, label='linear')
plt.plot(x,b, label='exponential')
plt.plot(x,c, label='flat')
plt.legend(loc='upper left', frameon=True)
plt.ylabel('The Y Label')
plt.xlabel('The X Label')
n = 1000
ax = np.random.randn(n)
ay = np.random.randn(n)
plt.scatter(ax, ay)