Python matplotlib:使加号更粗

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22172565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 00:25:37  来源:igfitidea点击:

matplotlib: make plus sign thicker

pythonmatplotlibmarkers

提问by Ricky Robinson

In Matplotlib, I would like to draw a thick plus sign(or a cross), but the one provided in the marker setis too thin.

在 Matplotlib 中,我想画一个粗加号(或十字),但是标记集中提供的那个太细了

Even as I increase its size, it doesn't get any thicker.

即使我增加它的尺寸,它也不会变得更厚。

For example: enter image description hereThe lines of codedrawing the red plus sign are:

例如在此处输入图片说明代码行绘制红色的加号是:

# Draw median marker.
if plot_opts.get('bean_show_median', True):
    ax.plot(pos, np.median(pos_data),
            marker=plot_opts.get('bean_median_marker', '+'),
            color=plot_opts.get('bean_median_color', 'r'))

If I add an extra parameter markersize=20, the marker will only stretch. It will be as thin as before. Can I make it thick?

如果我添加一个额外的参数markersize=20,标记只会拉伸。它会像以前一样薄。可以加厚吗?

采纳答案by Ricky Robinson

You can use markeredgewidth(or mew). You'll want to combine it with markersize, otherwise you get thick but tiny markers.

您可以使用markeredgewidth(或mew)。您需要将它与 结合使用markersize,否则您会得到粗而细小的标记。

For example:

例如:

plt.plot([2,4,6,1,3,5], '+', mew=10, ms=20)

enter image description here

在此处输入图片说明

回答by Stefan Marinov

Use markeredgewidthin connection with markersize.

使用markeredgewidth与连接markersize