8000 ENH: add fill argument to AnchoredSizeBar by magnunor · Pull Request #8829 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ENH: add fill argument to AnchoredSizeBar
  • Loading branch information
Magnus Nord authored and Magnus Nord committed Jun 30, 2017
commit e42be4dc3e853f9c45b4309adfcd8e770a8eb111
7 changes: 5 additions & 2 deletions lib/mpl_toolkits/axes_grid1/anchored_artists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member

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.

**kwargs):
"""
Draw a horizontal scale bar with a center-aligned label underneath.
Expand Down Expand Up @@ -288,6 +288,9 @@ def __init__(self, transform, size, label, loc,
Color for the size bar and label.
Defaults to black.

fill : bool, optional
Sizebar rectangle fill. Defaults to False.

label_top : bool, optional
If True, the label will be over the size bar.
Defaults to False.
Expand Down Expand Up @@ -336,7 +339,7 @@ def __init__(self, transform, size, label, loc,
"""
self.size_bar = AuxTransformBox(transform)
self.size_bar.add_artist(Rectangle((0, 0), size, size_vertical,
fill=False, facecolor=color,
fill=fill, facecolor=color,
edgecolor=color))

if fontproperties is None and 'prop' in kwargs:
Expand Down
0