Skip to content

Commit

Permalink
Fix error in length of scale bar (#14).
Browse files Browse the repository at this point in the history
The bar was drawn with an edge around it which made it longer than the
actual size.
  • Loading branch information
ppinard committed Jul 8, 2018
1 parent 82128ce commit 7f3683a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matplotlib_scalebar/scalebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def _get_value(attr, default):
if self.fixed_value is None:
length_px = abs(xlim[1] - xlim[0]) * length_fraction
length_px, value, units = self._calculate_best_length(length_px)
print(length_px)

# Mode 2: Fixed
else:
Expand All @@ -331,7 +332,7 @@ def _get_value(attr, default):
sizebar = AuxTransformBox(ax.transData)
sizebar.add_artist(Rectangle((0, 0), length_px, size_vertical,
fill=True, facecolor=color,
edgecolor=color))
edgecolor='none'))

txtscale = TextArea(scale_label, minimumdescent=False, textprops=textprops)

Expand Down

0 comments on commit 7f3683a

Please sign in to comment.