当前位置: 首页 > news >正文

matplotlib 默认属性和绘图风格

matplotlib 默认属性

  • 一、绘图风格
    • 1. 绘制叠加折线图
    • 2. Solarize_Light2
    • 3. _classic_test_patch
    • 4. _mpl-gallery
    • 5. _mpl-gallery-nogrid
    • 6. bmh
    • 7. classic
    • 8. fivethirtyeight
    • 9. ggplot
    • 10. grayscale
    • 11. seaborn
    • 12. seaborn-bright
    • 13. seaborn-colorblind
    • 14. seaborn-dark
    • 15. seaborn-dark-palette
    • 16. seaborn-darkgrid
    • 17. seaborn-talk
    • 18. seaborn-ticks
    • 19. fast
    • 20. seaborn-deep
    • 20. seaborn-muted
    • 21. seaborn-notebook
    • 22. seaborn-paper
    • 23. seaborn-pastel
    • 24. seaborn-poster
    • 25. seaborn-white
    • 26. seaborn-whitegrid
    • 27. tableau-colorblind10
    • 27. dark_background
  • 二、matplotlib 默认属性

一、绘图风格

print(plt.style.available) # 查看可选风格

plt.style.use('fivethirtyeight') # 使用那种风格
1.参数可以是文件路径 ...\site-packages\matplotlib\mpl-data\stylelib可参考此路径下文件
2.这个文件夹下,都是存放绘图风格文件,必须是“.mplstyle”结尾文件

1. 绘制叠加折线图

from matplotlib import pyplot as plt
plt.style.use('Solarize_Light2')  # 设置制图风格
plt.plot([1, 2, 3, 4, 5], [2, 3, 4, 5, 6], linestyle='--', c='r')
plt.plot([1, 2, 3, 4, 5], [3, 4, 5, 6, 7], linestyle='-.', c='g')
plt.legend(['A', 'B'])
plt.show()

2. Solarize_Light2

plt.style.use('Solarize_Light2')

在这里插入图片描述

3. _classic_test_patch

plt.style.use('_classic_test_patch')

在这里插入图片描述

4. _mpl-gallery

plt.style.use('_mpl-gallery')

在这里插入图片描述

5. _mpl-gallery-nogrid

plt.style.use('_mpl-gallery-nogrid')

在这里插入图片描述

6. bmh

plt.style.use('bmh')

在这里插入图片描述

7. classic

plt.style.use('classic')  # 超出坐标轴以外,是遮掩状态的

在这里插入图片描述

8. fivethirtyeight

plt.style.use('fivethirtyeight')

在这里插入图片描述

9. ggplot

plt.style.use('ggplot')

在这里插入图片描述

10. grayscale

plt.style.use('grayscale')

在这里插入图片描述

11. seaborn

plt.style.use('seaborn')

在这里插入图片描述

12. seaborn-bright

plt.style.use('seaborn-bright')

在这里插入图片描述

http://www.lryc.cn/news/258433.html

相关文章:

  • ip地址怎么转化为十进制
  • 【Spring进阶系列丨第五篇】详解Spring中的依赖注入
  • DAP数据集成与算法模型如何结合使用
  • 大数据监控
  • 【C语言】数据结构——小堆实例探究
  • Vue中比较两个JSON对象的差异
  • 前端知识库Html5和CSS3
  • 智能优化算法应用:基于鸡群算法3D无线传感器网络(WSN)覆盖优化 - 附代码
  • Apollo配置发布原理解析
  • TrustGeo论文问题理解
  • 子查询在SQL中的应用和实践
  • C# Socket通信从入门到精通(14)——多个异步UDP客户端C#代码实现
  • 【教3妹学编程-算法题】需要添加的硬币的最小数量
  • 【异常解决】SpringBoot + Maven 在 idea 下启动报错 Unable to start embedded Tomcat(已解决)
  • 做题总结 707. 设计链表
  • django实现--视图的使用
  • 【dirty cred】fileManager [XXX]
  • 线程按顺序循环执行
  • C# 使用异步委托获取线程返回值
  • 生鲜蔬果展示预约小程序作用是什么
  • 【C++】类与对象(下)
  • 一文了解 Go 方法
  • 【Docker】vxlan的原理与实验
  • 广度(宽度)优先搜素——层层递进
  • 设计模式——建造者模式(创建型)
  • ​getopt --- C 风格的命令行选项解析器​
  • Mysql大数据量删除
  • 【python中类的介绍】
  • PO模式在selenium自动化测试框架有什么好处
  • 智能优化算法应用:基于斑马算法无线传感器网络(WSN)覆盖优化 - 附代码