Skip to content

add 'auto' state for boxplot's patch_artist #28420

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

saranti
Copy link
Contributor

@saranti saranti commented Jun 19, 2024

PR summary

In #17959, it was generally agreed that it should be simpler to set the facecolor on a boxplot. I went with @timhoffm's idea to change the default to patch_artist='auto' which would use patches if any of the given parameters requires patches.

The 2 boxprops parameters that require a Patch artist are facecolor and edgecolor. If any of those 2 are passed, patch_artist will auto default to True. Otherwise, the rcparam will be respected.

PR checklist

@anntzer
Copy link
Contributor

anntzer commented Jun 19, 2024

I didn't look into this in detail, but would it be possible to just always switch to using a patch artist, using a strategy similar to #24455/#25247 ("auto-switch back to the old kind if the user tries to access the object") during the transition period?

@saranti
Copy link
Contributor Author

saranti commented Jun 19, 2024

I'll look into it

Edit: Always using a patch gives us a problem when someone tries to customize the box using setp or tries to call a Line2d method on the box, like in the IID bootstrap example. I don't see a way around that.

@saranti saranti marked this pull request as draft June 19, 2024 09:59
@saranti saranti added the status: needs comment/discussion needs consensus on next step label Jun 23, 2024
@saranti saranti requested a review from anntzer June 25, 2024 15:11
@anntzer
Copy link
Contributor

anntzer commented Jul 22, 2024

Edit: Always using a patch gives us a problem when someone tries to customize the box using setp or tries to call a Line2d method on the box, like in the IID bootstrap example. I don't see a way around that.

The point would be to auto-backconvert (with warning) to the "old" form if that happens, as in #24455/#25247.

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

Successfully merging this pull request may close these issues.

2 participants