import matplotlib.pyplot as plt # 导入matplotlib库 import numpy as np # 导入numpy库 # 准备数据 x = np.linspace(0, 10, 1000) y1 = np.sin(x) y2 = np.cos(x) # 画图 plt.figure(figsize=(10, 8)) # 创建画布 plt.plot(x, y1, label='sin') # 画sin曲线 plt.plot(x, y2, color='red', linestyle='--', label='cos') # 画cos曲线 plt.xlabel('x') # x轴标签 plt.ylabel('y') # y轴标签 plt.title('sin & cos') # 图标题 plt.legend() # 显示图示 plt.show() # 显示图像
上一篇: 下一篇:

相关推荐

随机推荐

  1. Qoo10趣天日本广告投标助手
  2. 西西趣天采集插件2.0升级版
  3. 西西电商图片下载助手
  4. 西西趣天韩国批量上货助手最新版
  5. 西西趣天日本批量上货助手最新版
  6. HeidiSQL_12.12绿色版
  7. WPS office 10.1.0.7311精简版(无联网功能)无广告超级好用
  8. dupeGuru – 电脑重复文件查找工具,支持跨平台使用!
  9. Caesium – 图片批量压缩软件
  10. 7-Zip 免费解压软件
  11. TrayS 绿色免安装版 (任务栏美化工具)
  12. AirDroid 3.7.2.1 Android 设备管家远程控制
  13. Snipaste截图软件下载
  14. Everything 1.4.1.1026 文件搜索工具
  15. chromium浏览器伪造sni工具网页版