Skip to content

axes.pie should support patch kwargs #3134

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

Open
JamesRamm opened this issue Jun 11, 2014 · 13 comments
Open

axes.pie should support patch kwargs #3134

JamesRamm opened this issue Jun 11, 2014 · 13 comments
Labels
keep Items to be ignored by the “Stale” Github Action MEP: MEP needed New feature

Comments

@JamesRamm
Copy link

axes.pie() creates a number of patches and text instances, but allows a limited subset of arguments in it's call signature.

It would be far more useful if it supported a kwargs argument, where the keyword arguments would be passed on to patch calls.

This would allow a gid to be set, encompassing each patch in the piechart (makes it much easier to then retrieve the handle to all elements of the pie chart for example, or include the pie chart)
Pickers could be set, edgecolor could be easily customised etc..

@JamesRamm
Copy link
Author

Best solution might be a new pie class, where texts and patches are implemented as seperate functions, to support kwargs for both:

class Pie()

def __init__(self, x, explode = None,
                    labels = None, colors = None, 
                    autopct = None, pctdistance = 0.6,
                    shadow = False, labeldistance = 1.1, 
                    startangle = None, radius = None)

    # assignment & validation here
    raise NotImplementedError

def create_wedges(self, **kwargs):
      # Create patch wedges & shadow
      raise NotImplementedError

def create_texts(self, **kwargs):
    # Create labels & 'autotexts'..
    raise NotImplementedError

def remove(self):
     raise NotImplementedError    

Could this fit with the existing API?

@tacaswell
Copy link
Member

Please see the version of pie on the master branch. I think this is already addressed.

@tacaswell
Copy link
Member

See issue #2923 .

@tacaswell
Copy link
Member

tacaswell commented Jun 11, 2014

I further consideration, I think have a pie class is a good idea, but for the purpose of artist wrangling after it is drawn.

@tacaswell tacaswell reopened this Jun 11, 2014
@JamesRamm
Copy link
Author

In that case, I suppose to make it most compatible with existing function, the pie.__init__ method would handle plotting (so that the call signature is unaffected) and update() methods would be provided, which accept patch/text kwargs to apply changes?

@tacaswell
Copy link
Member

Yes, that is what I had in mind. The mep would be for codifying how to do this in general and
related to the talk of moving towards a dom model for keeping track of artists.

@JamesRamm
Copy link
Author

This is daft, but I'm was trying to find out about MEP's - where they are/how they get written and I can't find anything.
Are MEP's and github issues one and the same?

@tacaswell
Copy link
Member

@tacaswell
Copy link
Member

@JamesRamm
Copy link
Author

HAving a go at starting a MEP for this:
https://github.com/matplotlib/matplotlib/wiki/MEP-26

@tacaswell
Copy link
Member

My thought was that this would be a specific case of what MEP25 is working on.

@petehuang
Copy link
Contributor

Hi,

This issue has been inactive for a while. What's the latest discussion on this? MEP25 was last updated in 2014, along with this issue. Thanks!

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@github-actions
Copy link

github-actions bot commented Mar 5, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Mar 5, 2023
@oscargus oscargus added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action MEP: MEP needed New feature
Projects
None yet
Development

No branches or pull requests

5 participants