-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: add fill argument to AnchoredSizeBar #8829
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fix API break
- can you also add a what_new entry in https://github.com/matplotlib/matplotlib/tree/master/doc/users/whats_new
@@ -232,7 +232,7 @@ class AnchoredSizeBar(AnchoredOffsetbox): | |||
def __init__(self, transform, size, label, loc, | |||
pad=0.1, borderpad=0.1, sep=2, | |||
frameon=True, size_vertical=0, color='black', | |||
label_top=False, fontproperties=None, | |||
fill=False, label_top=False, fontproperties=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put this last to not break the API. Technically someone could be passing in 12 positional arguments.
In general 👍 but needs a few tweaks. |
Fixed! I wasn't completely sure how to format the whats_new, since there were some variations in the already existing files in that folder. |
This was last changed in e5b5425 to fix #5757 . This change should not affect that (as the default does not change). It looks like what is going on is:
It would not be unreasonable to change the default value of fill based on if the height is >0 if fill is None:
fill = size_vertical > 0 Bit trickier to document, but probably more user-friendly in the long run. If we were to do this again, I would say that the default height should be |
Original concerns addressed, but should be some discussion over making default depend on size_vertical
Functionality being implemented in #8835 |
PR Summary
This pull request introduces a optional AnchoredSizeBar argument for filling the rectangle used in the sizebar.
Having the option to have a filled rectangle is useful when plotting scalebars for microscopy images, where this is the conventional way.
PR Checklist