Skip to content

properties instead of set_ and get_ #2674

@nilsbecker

Description

@nilsbecker

this is a possibly unrealistic feature request

one thing that annoyed me in using mpl from day 1 and continues to annoy me years later, is the verbose fig.set_, axes.set_ etc. interface.

it would be much nicer to have python properties throughout, so one would type
axes.aspect = 2 instead of axes.set_aspect(2)

i generally cannot remember names of functions and therefore i operate by typing until i can hit TAB in ipython to get completions. with python properties, i would need to type four letters less pretty much every single time i call a matplotlib method.

this is a major change in user interface, and so may be deemed not feasible. but i find it highly desirable. it might be possible to add this to the current way of doing things, and deprecate get_ and set_ only in the loooong run (3.0?)

the .set() methods can save typing and would be kept

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions