001.matplotlib.pyplot入门

001.matplotlib.pyplot入门

1.简单程序

  • 画图plot方法
  • 显示图片show方法
    在这里插入图片描述
    在这里插入图片描述

2.画多张图

在这里插入图片描述
在这里插入图片描述

3.figure函数

matplotlib.pyplot.figure(num=None, figsize=None, dpi=None, facecolor=None, edgecolor=None, frameon=True, FigureClass=<class ‘matplotlib.figure.Figure’>, clear=False, **kwargs)

  • num: 图的identifier,是唯一的(str或者int类型)
  • figsize(float, float): Width, height in inches.
  • facecolor:The background color.
  • edgecolor: The border color.

4.plot函数

4.1 常用的形式

# 一个figure里面一条线
plot([x], y, [fmt], *, data=None, **kwarg)
# 一个figure里面多条线
plot([x], y, [fmt], [x2], y2, [fmt2], ..., **kwarg)

[fmt]指的是线条的格式:[颜色,点型,线型]

4.2 其他参数

  • linewidth = 2 线宽
  • markersize = 12 点宽
  • label = ‘line1’ 线的标签,但是不会在图中显示

4.3 其他

点型
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值