stem plots:

ax.stem(x, y, '-.') draws the stem second,
so that it is visible on top of the dot.

Is this intentional?
(I think it looks better with the dot on top.)
How to reverse?

Alan Isaac

From: Alan G Isaac [mailto:aisaac@…310…]
Sent: Thursday, October 14, 2010 19:12

ax.stem(x, y, '-.') draws the stem second,
so that it is visible on top of the dot.

Is this intentional?
(I think it looks better with the dot on top.)
How to reverse?

I would usually place the dot on top, too. The stacking is determined by the
order of the plot commands in the stem method, but you could modify the zorder
[1] of the objects after the fact to order them as you like:

    markerline, stemlines, baseline = axes.stem(x, y, '-.')
    markerline.set_zorder(markerline.get_zorder() + 0.1)

[1] http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html

Nice idea.
Thanks,
Alan

···

On 10/22/2010 12:39 PM, Stan West wrote:

     markerline.set_zorder(markerline.get_zorder() + 0.1)

From: Alan G Isaac [mailto:aisaac@…310…]
Sent: Friday, October 22, 2010 13:25

> markerline.set_zorder(markerline.get_zorder() + 0.1)

Nice idea.
Thanks,

You're welcome. Now that I look at it again, I suppose that something like

    markerline.set_zorder(stemlines[0].get_zorder() + 0.1)

would better express the intent, even if the result is the same.

···

On 10/22/2010 12:39 PM, Stan West wrote:

Thanks.
Now I can easily get what I want.

But back to the underlying question:
do people really prefer the stems to overlay the markers?

I.e., are the ``stem`` defaults possibly incorrect?

Thanks,
Alan

···

On 10/25/2010 9:23 AM, Stan West wrote:

markerline.set_zorder(stemlines[0].get_zorder() + 0.1)