import matplotlib.pyplot as plt
import numpy as np
data = np.arange(100, 201)
plt.plot(data)
plt.show()
import matplotlib.pyplot as plt
import numpy as np
data = np.arange(100, 201)
plt.subplot(2, 1, 1)
plt.plot(data)
data2 = np.arange(200, 301)
plt.subplot(2, 1, 2)
plt.plot(data2)
plt.show()
import matplotlib.pyplot as plt
plt.plot([1, 2, 3], [3, 6, 9], '-r')
plt.plot([1, 2, 3], [2, 4, 9], ':g')
plt.show()
import matplotlib.pyplot as plt
import numpy as np
N = 20
plt.scatter(np.random.rand(N) * 100,
np.random.rand(N) * 100,
c='r', s=100, alpha=0.5)
plt.scatter(np.random.rand(N) * 100,
np.random.rand(N) * 100,
c='g', s=200, alpha=0.5)
plt.scatter(np.random.rand(N) * 100,
np.random.rand(N) * 100,
c='b', s=300, alpha=0.5)
plt.show()
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |