Skip to content

zorder is not respected by all parts of errorbar  #1622

Closed
@tacaswell

Description

@tacaswell

This was found by via a SO question (http://stackoverflow.com/questions/14003572/how-to-force-errorbars-to-render-last-with-matplotlib)

It looks like the root cause of this issue is that LineCollections do not take zorder as a parameter.

The hacky work around is to put negative zorder on the lines you want to be below the error bars.

import matplotlib.pyplot as plt
fig = plt.figure()
ax = plt.gca()
[ax.plot(rand(50),color='0.75') for j in range(122)];
ax.errorbar(range(50),rand(50),yerr=.3*rand(50))
plt.draw()

eb_wrong

fig = plt.figure()
ax = plt.gca()
[ax.plot(rand(50),color='0.75',zorder=-32) for j in range(122)];
ax.errorbar(range(50),rand(50),yerr=.3*rand(50))
plt.draw()

eb_hack

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions