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
matplotlib: make plus sign thicker
提问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:
The 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)


回答by Stefan Marinov
Use markeredgewidthin connection with markersize.
使用markeredgewidth与连接markersize。

