Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Artists should have a name attribute? #3033

Closed
JamesRamm opened this issue May 2, 2014 · 2 comments
Closed

Feature Request: Artists should have a name attribute? #3033

JamesRamm opened this issue May 2, 2014 · 2 comments

Comments

@JamesRamm
Copy link

It would be great if plotting methods accepted a name argument which would set a name attribute in the relevant artists. This would make GUI development with embedded matplotlib plots much easier.

In interactive applications we may create any number of plots within an axes - keeping track of them can be a problem. The label attribute is no good as this is used by legends, so needs to support 'nolegend' labels...

A name attribute would provide a mechanism by which to display a reference to a plot/data to the user and allow an artist object to be retrieved via its name.

A potential problem would be having artists of the same name. A solution could be to enforce unique names for each artist within an axes, or unique names for each artist type within an axes...
I think the second method would be preferred as this would allow different artist types to be grouped under the same name. There are many times where I encounter a situation where I plot some data (as e.g. Line2D) and plot related data (such as the standard deviation...as e.g. a polycollection via fill_between), but would like to treat these as one, or related objects for operations such as removing a plot from the axes.

@tacaswell
Copy link
Member

There is the gid on artists already which I think can be used as you want.

@tacaswell
Copy link
Member

Closing this as the gid attribute will solve the minimal version of the name problem.

One of the long-running design discussions is to re-factor the whole artist tree into a DOM-style structure which you can then walk. I think this would provide a way to logically group a collection of artists into a bucket which would let you bulk apply operations to all of the artists in the bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants