Hi, 2012/7/30 oc-spam65 <oc-spa...@laposte.net>: > Hello, > > Can the 'zorder' of the ticks be set? This minimal example shows a > hard-coded value of 2.5 > > This may come from file "matplotlib/axes.py", function "draw()". Can it > be adjusted? Shall it be bug-reported? > > ####################################################################### > import matplotlib.pyplot as pyplot > > fig = pyplot.figure() > ax = fig.add_subplot("111") > > ax.add_patch(pyplot.Rectangle((0,0), 1, 1, zorder=3)) > ax.xaxis.set_zorder(4) > # Expected behavior: the ticks should be drawn after the Rectangle, > # because 4 > 3. They should therefore be visible. > > pyplot.show() > # Problem: The ticks are hidden by the rectangle, contrary to the > # expected behavior. > > print(ax.xaxis.get_zorder()) > # Prints 2.5 instead of 4! > > #######################################################################
I confirm the bug on matplotlib v: 1.1.0, Kubuntu 11.04, Python 2.7.1+ >>> ax.xaxis.set_zorder(4) >>> ax.xaxis.get_zorder() >>>> 4 >>> plt.draw() >>> ax.xaxis.get_zorder() It seems that the call to draw or show sets the zorder to default, instead of updating it. @Mr Spam (can you sign your mail, please) In one of my scripts managed to set zorder to the spines as, e.g., ax.spines['left'].set_zorder(101). This puts the axis spine well on top, but ax.xaxis.set_zorder does nothing. I've also found a method ax.tick_params, that has a zorder keyword, but it does nothing too. Cheers, Francesco > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users