Matplotlib入门系列1_创建

2019年7月15日14:34:34

环境

Python3.6

前言

Matplotlib的一些基础知识

1、创建
2、简单的plt例子
3、绘图样式的修改
4、一次创建多个子图
5、保存图片
6、关于Matplotlib中文乱码这回事

直接上代码操作,可以体验一下,自己根据自己需要修改即可。
关于实际效果的生成,自己实际运行一下就会显示,截图还是有点麻烦的,就不截图了。

建议刚开始读一下官网对这个库的基本介绍
		英文阅读有点吃力的话,使用谷歌浏览器的谷歌翻译插件,网页全部翻译为中文阅读即可。
官网:
        https://matplotlib.org/tutorials/introductory/usage.html#sphx-glr-tutorials-introductory-usage-py

创建

# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   @File:          创建几个子图.py
   @Author :        hyh
   @Ide:            Pycharm
   @Contact:        hyh_youxiang@163.com
   @Date:          19-7-15 上午10:56
   
-------------------------------------------------
   Description :
        建议刚开始读一下官网对这个库的基本介绍,英文阅读有点吃力的话,使用谷歌浏览器的谷歌翻译插件,网页全部翻译为中文阅读即可。
   官网:
        https://matplotlib.org/tutorials/introductory/usage.html#sphx-glr-tutorials-introductory-usage-py
-------------------------------------------------
"""

import matplotlib.pyplot as plt


def main():
    fig = plt.figure()  # an empty figure with no axes
    fig.suptitle('No axes on this figure')  # Add a title so we know which it is

    fig, ax_lst = plt.subplots(2, 2)  # a figure with a 2x2 grid of Axes

    fig.show()


if __name__ == '__main__':
    main()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xiaozi_001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值