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

matplotlib kwarg de-aliasing helper function #1041

Closed
OriolAbril opened this issue Feb 3, 2020 · 5 comments · Fixed by #1073
Closed

matplotlib kwarg de-aliasing helper function #1041

OriolAbril opened this issue Feb 3, 2020 · 5 comments · Fixed by #1073
Labels
Feature Request New functionality requests from users Help Wanted

Comments

@OriolAbril
Copy link
Member

Tell us about it

There are many kwarg arguments in matplotlib that accept an alias, which can get quite messy when ArviZ sets default values for them. I propose to pass the kwarg dicts through this helper function and then always work internally with the complete name.

Thoughts on implementation

Use a matplotlib internal function if it exists? Otherwise we should create one (or several, see note).

Note: some aliases are not universal like the case of color and c in a scatter plot.

References that may (or not) be useful: Line2D properties and Collection properties

@OriolAbril OriolAbril added Help Wanted Feature Request New functionality requests from users labels Feb 3, 2020
@percygautam
Copy link
Contributor

I'll like to work on this one!

@percygautam
Copy link
Contributor

I found the kwarg normalization in matplotlib here. This function is then used like this here to set properties.
Are we looking for something like this? I think we can create a helper function which calls this normalize_kwargs function from matplotlib and will set properties( as is done in case of matplotlib).

@ahartikainen
Copy link
Contributor

Yes, something similar.

@percygautam
Copy link
Contributor

Hey, I was working some examples in the cookbook. Can you please confirm this is what we are looking for.
Also, Should we create multiple de-aliaser dicts or just add all in one ? Even if user add some wrong kwarg, matplotlib can handle the errors.

@percygautam
Copy link
Contributor

percygautam commented Feb 16, 2020

@ahartikainen Should I make different functions for scatter plots and other plots, or use conditionals in one function?
Also, how to deal with plot_kwargs of compareplot where we are explicitely defining them like marker_ic and marker_dse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New functionality requests from users Help Wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants