如何在matplotlib中使线上的标记更小? [英] How to make markers on lines smaller in matplotlib?

查看:41
本文介绍了如何在matplotlib中使线上的标记更小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处有关 matplotlib 标记的文档告诉我,我可以使用几种样式的标记.例如,我可能有 '-o' 代表直线上的圆圈,'-*' 代表直线上的星星和 '-s'>表示在线上的正方形.

The documentation on matplotlib markers here teaches me I can have several styles of the markers. For example, I may have '-o' for circles on the line, '-*' for stars on the line and '-s' for square on the line.

但是,它们对我来说似乎太大了.就像,当我这样做

However, they all appear to be too big for me. Like, when I do

axes.errorbar(x, y, yerr=ci, fmt='-o', color='k')

我知道

为了让它们更小,我尝试过

To make them smaller, I tried

axes.errorbar(x, y, yerr=ci, fmt='-o', s=1, color='k')

但没有运气.

如何使行中的标记变小?

推荐答案

您可以使用 markersize 参数来更改标记的大小:

You can use markersize argument to change the size of the markers:

plt.errorbar(x, y, yerr=err, fmt='-o',  markersize=2, color='k', label = 'size 2')

像这样

这篇关于如何在matplotlib中使线上的标记更小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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