图例参考:http://matplotlib.org/gallery.html

API参考:http://matplotlib.org/api/pyplot_summary.html

# -*- coding:utf-8 -*-
"""
Simple demo with multiple subplots.
"""
import numpy as np
import matplotlib.pyplot as plt x1 = np.linspace(0.0, 5.0 )
x2 = np.linspace(0.0, 2.0 ) y1 = np.cos(2 * np.pi * x1) * np.exp(-x1)
y2 = np.cos(2 * np.pi * x2) #第一张大图
plt.subplot(2, 1, 1) #
plt.plot(x1, y1, 'ro-')
plt.title('A tale of 2 subplots')
plt.ylabel('Damped oscillation') plt.subplot(2, 1, 2)
plt.plot(x2, y2, '.-')
plt.xlabel('time (s)')
plt.ylabel('Undamped') plt.figure(2) #第二张大图
plt.plot(x1,y1,'o-', label="line1") #添加label说明
plt.plot(x2,y2,'.-', label='line2') #添加label说明
plt.axis([0, 5, -1, 1]) #指定坐标系
plt.legend(loc='best', ncol=1, prop={'size':16}, columnspacing=0.5) #添加备注, loc位置,
plt.title("title")
plt.xlabel("xlabel")
plt.ylabel("ylabel") plt.show()

最新文章

  1. 实战JS正则表达式
  2. 走进AngularJs(一)angular基本概念的认识与实战
  3. 学习vulkan的几个有用的网址
  4. MIME Sniffing
  5. Andriod ADB开启Activity、Service以及BroadCast(包括参数的传递)
  6. Uva10328 dp(递推+高精度)
  7. OSI安全体系结构
  8. 基于邻接表的广度优先搜索遍历(bfs)
  9. JavaScript constructors, prototypes, and the `new` keyword
  10. BZOJ3190[JLOI2013]赛车
  11. C# 多线程、结构体
  12. 安装MySQL后出现发生系统错误2或者系统找不到指定的文件
  13. 我是怎么知道 PTHREAD_MUTEX_INITIALIZER 是什么鬼东西的 ??
  14. Response()的对象
  15. Java使用RabbitMQ之整合Spring(消费者)
  16. 【tmos】字段update_time如何动态的更新
  17. 开启hadoop集群
  18. Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
  19. android 8.0 intent安装apk失败屏幕闪过
  20. asp.net core 系列之用户认证(1)-给项目添加 Identity

热门文章

  1. python之黏包和黏包解决方案
  2. 获取url参数的方法(web)
  3. 我的Java之旅 第一课 开发环境准备
  4. loadrunner 运行场景-命令行运行场景
  5. log4net 写入日志到不同的位置
  6. 在ASP.NET Core 2.0 web项目中使用EntityFrameworkCore
  7. apache 80端口占用问题
  8. c#中//注释和///注释的区别
  9. CorelDRAW(cdr) 2018安装教程详解
  10. cglib之Enhancer