网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

matplotlib添加标注

时间:2024-10-22 18:12:00

1、软件安装及运行,见上一篇经验,“用matplotlib画图"

2、输入以下代码,或直接复制粘贴,注意格式import numpy as npimport matplotlib.pyplot as pltax = plt.subplot(111)t = np.arange(0.0, 5., 0.01)s = np.cos(2*np.pi*t)line, = plt.plot(t, s, linewidth = 3)plt.annotate('local max', xy = (2, 1), xytext = (3, 1.5), \arrowprops = dict(facecolor = 'black', shrink = 0.1))plt.ylim(-2, 2)plt.show()

matplotlib添加标注
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com