Hello,
I have run across an inconsistency in the zorder of markers and lines
in the legend for an errorbar as opposed to a plot in matplotlib
v1.1.0. After some considerable amount of time reading
legend_handler.py and the information at
http://matplotlib.sourceforge.net/users/legend_guide.html I was unable
to figure out how to make the errorbar markers sit 'on top' of the
lines in a legend.
For example the following code:
import pylab as pl
import numpy as np
x = pl.arange(-2,2,0.1)
y = x**2
dy = np.random.random(len(x))
pl.figure(1)
pl.plot(x,y, color='k', linewidth=0.5, linestyle='-', marker='o',
markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
label='line1', markersize=10)
pl.legend(loc='best', frameon=False)
pl.figure(2)
pl.errorbar(x,y,yerr=dy, color='k', linewidth=0.5, linestyle='-', marker='o',
markerfacecolor='lime', markeredgecolor='k', markeredgewidth=0.5,
label='line1', markersize=10, ecolor='lime', capsize=10)
pl.legend(loc='best', frameon=False)
pl.show()
produces a legend for the plot (figure(1)) with the markers on top of
the lines, but the legend for the errorbar (figure(2)) has this
reversed.
Any ideas/suggestions would be greatly appreciated.
Best,
Adrian.