I had recently experienced a frustration regarding zorder and clip_on in Matplotlib.
In figure 1 attached here, I would like to put blue horizontal error bars above the x-axis. As you can see right now, half of it is cut by the x-axis (for the blue point at H = 0). I used:
axes.errorbar(data[:,0], data[:,1], xerr=data[:,2], fmt=’’, ls ="", c = ‘b’, capthick=2, elinewidth=2, clip_on = False, zorder = 10)
But even if I change zorder = 1000, the error bar never goes above the axis. Is it a bug?
Regarding the same topic, I also discovered that when using axes.twinx() in Figure 2 (A : axes; B : axes2 = axes.twinx()). The blue curve (A) never goes above the red curve (B), whatever zorder I use. I even tried axes2.set_axisbelow(True), but it doesn’t change anything. I really want “axes2” to be below the “axes”. Is it a bug? I had to change it manually with Illustrator and it worked, but it is of course really not convenient.
Thank you very much for your help !
Figure 2.pdf (47.3 KB)
Figure 1.pdf (79.3 KB)