Fix errorbar zorder v1.2 #1628

Merged
merged 5 commits into from Jan 2, 2013

Projects

None yet

4 participants

@tacaswell
Member

fix for issue #1622 + unit test.

@tacaswell
Member

The 3.1 build failed with errors that look like Travis didn't actually use 3.1 to run the tests.

@dmcdougall dmcdougall was assigned Dec 31, 2012
@dmcdougall
Member

@tacaswell Thanks for the patch. I'll leave this up for a day or so to allow the opinions of others to roll in before merging.

@WeatherGod
Member

A related issue: #409

@dmcdougall
Member

@WeatherGod Does this patch fix that issue for you?

@WeatherGod
Member

I have yet to check, I was merely noting it for posterity. I have a huge backlog of emails to work through today...

@tacaswell tacaswell removed redundant code
Do not need to explicitly call set_zorder because it gets done
in the call to coll.update.
269190e
@mdboom
Member
mdboom commented Jan 2, 2013

+1

@dmcdougall dmcdougall commented on an outdated diff Jan 2, 2013
lib/matplotlib/tests/test_axes.py
@@ -936,3 +936,34 @@ def test_transparent_markers():
if __name__=='__main__':
import nose
nose.runmodule(argv=['-s','--with-doctest'], exit=False)
+
+
+@image_comparison(baseline_images=['vline_hline_zorder',
+ 'errorbar_zorder'])
+def test_eb_line_zorder():
+ x = range(10)
+
+ # First illustrate basic pyplot interface, using defaults where possible.
+ fig = plt.figure()
+ ax = fig.gca()
+ ax.plot(x,lw=10,zorder=5)
+ ax.axhline(1,color='red',lw=10,zorder=1)
+ ax.axhline(5,color='green',lw=10,zorder=10)
+ ax.axvline(7,color='m',lw=10,zorder=7)
+ ax.axvline(2,color='k',lw=10,zorder=3)
@dmcdougall
dmcdougall Jan 2, 2013 Matplotlib Developers member

PEP8: A space is needed after each comma in the above calls to ax[vh]line.

@dmcdougall
dmcdougall Jan 2, 2013 Matplotlib Developers member

And the call to plot.

@dmcdougall dmcdougall commented on an outdated diff Jan 2, 2013
lib/matplotlib/tests/test_axes.py
+ ax.axvline(7,color='m',lw=10,zorder=7)
+ ax.axvline(2,color='k',lw=10,zorder=3)
+
+ ax.set_title("axvline and axhline zorder test")
+
+
+ # Now switch to a more OO interface to exercise more features.
+ fig = plt.figure()
+ ax = fig.gca()
+ x = range(10)
+ y = np.zeros(10)
+ yerr = range(10)
+ ax.errorbar(x,y,yerr=yerr,zorder=5,lw=5,color='r')
+ for j in range(10):
+ ax.axhline(j,lw=5,color='k',zorder=j)
+ ax.axhline(-j,lw=5,color='k',zorder=j)
@dmcdougall
dmcdougall Jan 2, 2013 Matplotlib Developers member

Also, spaces in these calls too.

@dmcdougall
Member

Once those nitpicks are addressed I'll merge this. Thanks @tacaswell.

@dmcdougall dmcdougall merged commit 894742b into matplotlib:v1.2.x Jan 2, 2013

1 check failed

Details default The Travis build failed
@tacaswell tacaswell deleted the tacaswell:fix_errorbar_zorder_v1.2 branch Jan 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment