This is correct. To support legend handle like --o-- (i.e., no markers
at the ends), lines and markers are drawn as a separate artist. You
may use something like,
I, personally, recommend you to use a proxy artist.
You may do something like
# creates artists for legend purpose only
l1, = pylab.plot(pylab.linspace(0,1,100), 'ko-')
l2, = pylab.plot(pylab.linspace(0,1,100), 'ko')
# remove them from the axes.
leg=pylab.legend([l1, l2], ["Test 1", "Test 2"], loc='best')
On Wed, Sep 5, 2012 at 6:05 AM, Sterling Smith <smithsp@...3304...> wrote:
I still do not get black markers. Furthermore, if you try to make a new legend with the result of leg.get_lines(), you will get lines without markers, which leads me to the conclusion I stated in my previous email (which you did not copy)
I suspect that this is because the legend marker is drawn separately from the legend line to accommodate the numpoints argument of the legend functions. Then the question is how to access these markers if they are separate from the line2d objects in the legend. I didn't even see them in the children of the legend [legend.get_children()].