matplotlib: make plus sign thicker

PythonMatplotlibMarkers

Python Problem Overview


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: enter image description here 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?

Python Solutions


Solution 1 - Python

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)

enter image description here

Solution 2 - Python

Use markeredgewidth in connection with markersize.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRicky RobinsonView Question on Stackoverflow
Solution 1 - Pythonuser707650View Answer on Stackoverflow
Solution 2 - PythonStefan MarinovView Answer on Stackoverflow