matplotlib中是否有线型列表? [英] Is there a list of line styles in matplotlib?

查看:133
本文介绍了matplotlib中是否有线型列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个脚本,可以进行一些绘图.我希望它绘制几个数据系列,每个数据系列都有其独特的线条样式(而不是颜色).我可以轻松地遍历一个列表,但是python中已经有这样的列表了吗?

解决方案

根据标记

最新版本中,仍然有相同的内容样式,但是您可以改变点/线之间的间距.

I'm writing a script that will do some plotting. I want it to plot several data series, each with its unique line style (not color). I can easily iterate through a list, but is there such a list already available in python?

解决方案

According to the doc you could find them by doing this :

from matplotlib import lines
lines.lineStyles.keys()
>>> ['', ' ', 'None', '--', '-.', '-', ':']

You can do the same with markers

EDIT: In the latest versions, there are still the same styles, but you can vary the space between dots/lines.

这篇关于matplotlib中是否有线型列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆