matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

add 'auto' state for boxplot's patch_artist

Open saranti opened this issue 1 year ago • 2 comments

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

saranti avatar Jun 19 '24 03:06 saranti

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?

anntzer avatar Jun 19 '24 05:06 anntzer

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 avatar Jun 19 '24 08:06 saranti

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.

anntzer avatar Jul 22 '24 13:07 anntzer