Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zorder=None not properly handled #9785

Closed
@jsh9

Description

@jsh9

Matplotlib developers:

I have some feature requests and/or questions about the grid behaviors in matplotlib v2.0+:

(1) Is it possible to set the default grid line to even lighter gray, and even thinner line width? Just like the style in MATLAB? The current new Matplotlib defaults generate grid lines that look too pronounced.

In fact, when using Matplotlib 2.0+, I always use plt.grid(ls=':') instead of just plt.grid(). It looks much better.

(2) The zorder behavior, if set to None, is undefined, or at least not documented clearly.

For example, I tried the following codes respectively:

plt.figure(); plt.plot([0,1],[0,1],lw=10); plt.grid()
plt.figure(); plt.plot([0,1],[0,1],lw=10,zorder=None); plt.grid()
plt.figure(); plt.plot([0,1],[0,1],lw=10); plt.grid(zorder=None)
plt.figure(); plt.plot([0,1],[0,1],lw=10,zorder=None); plt.grid(zorder=None)

and I am getting confusing results.

There is indeed some needs to pass None to zorder, especially when designing wrapper functions where zorder sometimes needs to be specified by the user, and sometimes doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions