8000 Annotation: always use FancyBboxPatch instead of bbox_artist by efiring · Pull Request #4178 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Annotation: always use FancyBboxPatch instead of bbox_artist #4178

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

Merged
merged 9 commits into from
Jul 22, 2015
Prev Previous commit
Handle the case in which boxstyle is a callable, not a string
  • Loading branch information
efiring committed Jul 20, 2015
commit 9eceef3b9c9554171b65d4eb62340a67d9180f12
9 changes: 6 additions & 3 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def get_rotation(rotation):
animated [True | False]
backgroundcolor any matplotlib color
bbox rectangle prop dict plus key 'pad' which is a
pad in points; if a boxstyle is supplied, then
pad is instead a fraction of the font size
pad in points; if a boxstyle is supplied as
a string, then pad is instead a fraction
of the font size
clip_box a matplotlib.transform.Bbox instance
clip_on [True | False]
color any matplotlib color
Expand Down Expand Up @@ -498,7 +499,9 @@ def set_bbox(self, rectprops):
else:
if pad is None:
pad = 0.3
if "pad" not in boxstyle:

# boxstyle could be a callable or a string
if is_string_like(boxstyle) and "pad" not in boxstyle:
boxstyle += ",pad=%0.2f" % pad

bbox_transmuter = props.pop("bbox_transmuter", None)
Expand Down
0