matplotlib - Jupyter Notebook
matplotlib - Jupyter Notebook
In [2]: a = np.arange(0,10)
In [3]: a
In [4]: plt.plot(a)
In [17]: plt.axis([0,10,0,15])
plt.plot(a, 'ro')
plt.xlabel('X axis')
plt.ylabel('Y axis')
plt.text(2,10,"This is the location")
plt.title('My First Plot')
plt.grid(True)
In [18]: a = np.arange(0,20,2)
b = np.arange(1,20,2)
plt.plot(a,'r')
plt.plot(b,'b')
In [21]: plt.subplot(221)
plt.plot(a,'r')
plt.subplot(222)
plt.plot(b,'b')
plt.subplot(223)
plt.plot(a,'g')
plt.subplot(224)
plt.plot(b,'y')
In [23]: data
Out[23]: array([36, 53, 5, 55, 78, 44, 24, 19, 31, 98, 7, 47, 51, 63, 94,
3, 8,
6, 21, 9, 35, 96, 69, 78, 82, 12, 9, 93, 15, 87, 26, 8,
11, 26,
92, 38, 9, 56, 25, 11, 23, 80, 64, 44, 38, 58, 8, 72, 80,
71, 25,
18, 53, 26, 16, 47, 97, 0, 16, 8, 0, 74, 49, 49, 84, 75,
46, 89,
81, 49, 25, 42, 2, 32, 23, 17, 71, 66, 82, 10, 79, 76, 38,
6, 69,
29, 11, 36, 57, 99, 36, 17, 19, 64, 94, 33, 37, 94, 52, 4
5])
Out[24]: (array([15., 13., 11., 11., 10., 8., 6., 9., 8., 9.]),
array([ 0. , 9.9, 19.8, 29.7, 39.6, 49.5, 59.4, 69.3, 79.2, 89.
1, 99. ]),
<BarContainer object of 10 artists>)
In [ ]: