python plt修改绘图区大小_Python可视化|matplotlib04-绘图风格(plt.style)大全

目录

1、matplotlib有哪些绘图风格
2、绘图风格使用
3、26种风格效果是什么样子的
4、参考资料

欢迎随缘关注@pythonic生物人


1、matplotlib有哪些绘图风格

使用plt.style.available输出所有风格名称,共计26种。

import matplotlib.pyplot as plt     
 print(plt.style.available)
['bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-bright', 'seaborn-colorblind', 'seaborn-dark-palette', 'seaborn-dark', 'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook', 'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk', 'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'seaborn', 'Solarize_Light2', 'tableau-colorblind10', '_classic_test']

每种风格的源码都在路径xxLibsite-packagesmatplotlibmpl-datastylelib之下,您可以模仿着自定义一个自己的风格,这很简单。

c437684479574b821d247c74faa5834f.png

点开一个ggplot的绘图风格看看 ,里面都是线型,颜色等的设置。

46807775136779737e35faf3277b36ea.png

2、 绘图风格使用

例如,使用ggplot风格。

plt.style.use('ggplot')

3、26种风格效果是什么样子的

a5e2995b2024cc93b1d95f35fd5ca15c.png

7a293a0a077a1b8724e6962325c7f8a2.png

c481bf5b88867c44f011b6a6d4aaad31.png

7478dccc0a8c2df6837b629b206fd00a.png

4、参考资料

https:// matplotlib.org/gallery/ style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py

欢迎随缘关注@pythonic生物人

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值