Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5eaab3b

Browse files
Make the horizontal bar appear in AnchoredArtists example.
The `AnchoredSizeBar` should, according to its comment string > Draw a horizontal bar with the size in data coordinate of the given axes. A label will be drawn underneath (center-aligned). This bar is not drawn, because from matplotlib 2.0 on, patches do not have any edge assigned to them any more. While the facecolor is set to `"None"`, it is really the edgecolor, which should be set to some color (e.g. black). This PR fixes this such that a bar appears in the plot.
1 parent 19c2e78 commit 5eaab3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/misc/anchored_artists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, transform, size, label, loc,
3434
sep in points.
3535
"""
3636
self.size_bar = AuxTransformBox(transform)
37-
self.size_bar.add_artist(Rectangle((0, 0), size, 0, fc="none", lw=1.0))
37+
self.size_bar.add_artist(Rectangle((0, 0), size, 0, ec="black", lw=1.0))
3838

3939
self.txt_label = TextArea(label, minimumdescent=False)
4040

0 commit comments

Comments
 (0)