import numpy as np import matplotlib.pyplot as mp mp.subplot(2, 2, 1) x = np.array([1, 2, 3]) y = np.array([4, 0, 4]) mp.plot(x, y) mp.subplot(2, 2, 2) mp.hlines(1, 1, 1.5) mp.vlines([2.5, 3], [0.5, 0.5], [1.5, 1.5]) mp.plot(x, y) mp.subplot(2, 2, 3) mp.scatter(2, 0, color='g', marker='o', label='sample points', edgecolors='b', s=200) mp.plot(x, y) mp.legend() mp.show()
matplotlib 画图函数(一)
最新推荐文章于 2024-06-19 17:52:16 发布