I am using matplotlib version 1.4.3 and I wanted to make a Violinplot and I wanted to show the mean and the median, which is easy to do but I want to mark the mean and median so they can easily be distinguished between, by changing the colour and/or shape of one of them but I cannot see anything in the documentation that allows for that.
Anyhelp would be greatly appreciated.
violinplot(x, showmeans=True, showmedians=False, widths=1.0, showextrema=False)
Example Violinplot with means and medians:

Hint: when looking at a method's docstring never miss the Returns part.
data = np.random.weibull(1.5, size=(1000, 3))
r = plt.violinplot(dataset=data, showmeans=True, showmedians=True,
                   widths=1.0, showextrema=False)
r['cmeans'].set_color('b')
r['cmedians'].set_color('g')

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With