matplotlib:使加号更厚

时间:2014-03-04 12:55:41

标签: python matplotlib markers

在Matplotlib中,我想画一个粗加号(或十字),但marker set中提供的那个太强

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

exampleenter image description here 绘制红色加号的lines of code是:

# 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'))

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

2 个答案:

答案 0 :(得分:93)

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

例如:

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

enter image description here

答案 1 :(得分:11)

结合markersize使用markeredgewidth

相关问题