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

Skip to content

Is it a better solution to access one of the spines by class attribute? #17100

Closed
@y9c

Description

@y9c

hiding spines is very common in creating a new plot by matplotlib, and the flowing lines of code are widely used.

ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)

They are a little comprehensive for new users to remember, and is easy to get wrong.

Will it possible to access the spine by class attribute and make matplotlib more object-oriented, with this mirror change.

ax.spines.top.set_visible(False)
ax.spines.right.set_visible(False)

or even,

ax.spines.top = None
ax.spines.right = None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions