Skip to content

Axes.grid() not honoring specified "zorder" kwarg #5045

Closed
@megies

Description

@megies

Axes.grid() is not honoring a provided custom zorder. Instead the grid's zorder seems to be fixed at some miraculous value in between 2.5 and 2.6 (I could not find a key for grid zorder in rcParams). This can be annoying because than all other artists zorder have to be adjusted around the grid zorder as opposed to only changing the zorder of the grid.

Edit: I'm on mpl 1.4.3

Example:

import matplotlib.pyplot as plt 
ax = plt.gca()
ax.grid(lw=30, ls="-", zorder=-10)
ax.text(0, 0.5, "spam", color="r", size=200, zorder=2.5)
ax.text(0, 0, "eggs", color="g", size=200, zorder=2.6)
plt.show()

figure_x

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions