matplotlib的基本用法(一)——figure的使用
来源:互联网 发布:收购博客玩家数据 编辑:程序博客网 时间:2024/06/07 01:57
文章作者:Tyan
博客:noahsnail.com | CSDN | 简书
本文主要是关于matplotlib的一些基本用法。
- Demo 1
import matplotlib.pyplot as pltimport numpy as np# 绘制普通图像x = np.linspace(-1, 1, 50)y = 2 * x + 1plt.plot(x, y)plt.show()# 绘制普通图像y = x**2plt.plot(x, y)plt.show()
- 结果
- Demo 2
# figure的使用x = np.linspace(-1, 1, 50)y1 = 2 * x + 1# figure 1plt.figure()plt.plot(x, y1)# figure 2y2 = x**2plt.figure()plt.plot(x, y2)# figure 3,指定figure的编号并指定figure的大小, 指定线的颜色, 宽度和类型y2 = x**2plt.figure(num = 5, figsize = (4, 4))plt.plot(x, y1)plt.plot(x, y2, color = 'red', linewidth = 1.0, linestyle = '--')plt.show()
- 结果
0 0
- matplotlib的基本用法(一)——figure的使用
- matplotlib的基本用法(十七)——保存figure
- matplotlib的基本用法(十四)——figure图的嵌套
- matplotlib的基本用法(十三)——figure绘制多图
- matplotlib的figure窗口
- matplotlib的基本用法(二)——设置坐标轴
- matplotlib的基本用法(三)——调整坐标轴
- matplotlib的基本用法(四)——设置legend图例
- matplotlib的基本用法(五)——添加annotation
- matplotlib的基本用法(六)——设置坐标轴label
- matplotlib的基本用法(七)——绘制散点图
- matplotlib的基本用法(八)——绘制柱状图
- matplotlib的基本用法(十)——绘制Image
- matplotlib的基本用法(十五)——主次坐标轴
- matplotlib的基本用法(十六)——创建动画
- matlab figure的用法
- Matlab: figure的用法
- figure,figcaption的用法
- 4.27
- CCF NOI1064 计算斐波那契第n项
- 1016. 部分A+B (15)
- c# 设置禁止改变窗体大小
- C++抽象编程——接口(5)——随机数算法
- matplotlib的基本用法(一)——figure的使用
- 使用Scala模拟简单的RPC通信,Socket编程
- bzoj3697: 采药人的路径
- AngularJs组件
- codeforces 9C (DFS)之 Hexadecimal's Numbers
- 欢迎使用CSDN-markdown编辑器
- python-内置函数filter()
- 第七讲AngularJS 过滤器
- 记我在软件公司的一年