I would like to adjust the height of the errorbars as shown in the matplotlib legend, so as to avoid that they are bumping into each other (shown below).
I'm aware of this post Matplotlib: Don't show errorbars in legend that discusses how to remove the errorbars, but I don't know what to do to adjust the handler so that the error bars are still there, just shortened.
A working example with overlapping errorbars is:
import matplotlib
font = {'family' : 'serif',
'serif': 'Computer Modern Roman',
'weight' : 'medium',
'size' : 19}
matplotlib.rc('font', **font)
matplotlib.rc('text', usetex=True)
fig,ax1=plt.subplots()
h0=ax1.errorbar([1,2,3],[1,2,3],[1,2,1],c='b',label='$p=5$')
h1=ax1.errorbar([1,2,3],[3,2,1],[1,1,1],c='g',label='$p=5$')
hh=[h0,h1]
ax1.legend(hh,[H.get_label() for H in hh],bbox_to_anchor=(0.02, 0.9, 1., .102),loc=1,labelspacing=0.01, handlelength=0.14, handletextpad=0.4,frameon=False, fontsize=18.5)
I'm using version 1.5.1 of matplotlib, but I don't think that that's the issue.