matplotlib: make plus sign thicker

二次信任 提交于 2019-11-27 11:52:15

问题


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

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

For example:

The lines of code drawing 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?


回答1:


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

For example:

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




回答2:


Use markeredgewidth in connection with markersize.



来源:https://stackoverflow.com/questions/22172565/matplotlib-make-plus-sign-thicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!