Seriously, just look at the matplotlib image gallery (http://matplotlib.org/gallery.html)
In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import random
In [ ]:
x = np.arange(-10.0,10.0,0.1)
y1 = np.exp(-x**2/8.0) + 1.0
y2 = np.exp(-x**2/8.0) + 1.0
#y = np.zeros_like(x)
In [ ]:
x += 0.3*(np.random.rand(x.size)-0.5)
y1 += 0.3*(np.random.rand(x.size)-0.5)
In [ ]:
plt.plot(x,y2,'b-',linewidth=3)
plt.plot(x,y1,'r.')
plt.xlim(-12,12)
plt.ylim(0.5,2.5)
plt.xlabel('x values')
plt.ylabel('y values')
plt.title('some noise')
plt.grid(True)
plt.annotate('this is important!',xy=(2,2.0),fontsize=15)
plt.yscale('log')
In [ ]:
val2 = np.random.normal(loc=5.0,scale=2.0,size=10000)
In [ ]:
n, bins, patches = plt.hist(val2,20, facecolor='g')
plt.xlabel('x vals')
plt.ylabel('y vals')
plt.axis([-5,15,0,2000])
#plt.yscale('log')
In [ ]: