11.23读书笔记

import numpy as np
ls1 = [10, 42, 0, -17, 30]
nd1 =np.array(ls1)
print(nd1)
print(type(nd1))
fig = plt.figure()
ax = fig.add_subplot(2, 2, 1)
y = np.random.randn(100)
plt.plot(y);
ax.set_title('1')
 
y = np.random.rand(5)
x = np.arange(5)
ax = fig.add_subplot(2, 2, 2)
plt.bar(x, y)
ax.set_title('2');
 
y = np.random.rand(5)
y = y / np.sum(y)
y[y < .05] = .05
ax = fig.add_subplot(2, 2, 3)
plt.pie(y)
ax.set_title('3')
 
plt.draw()
plt.show()

posted @ 2020-11-23 18:54  NIUFI  阅读(42)  评论(0)    收藏  举报