Skip to content

Commit 0b6951d

Browse files
authored
Merge pull request #307 from lysackm/last-legend-bin-units
Add unit to legend label for the last bin
2 parents 499ae6f + 208b830 commit 0b6951d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

windrose/windrose.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ def get_labels(decimal_places=1, units=None):
264264
labels = [
265265
fmt.format(digits[k], digits[k + 1]) for k in range(len(digits) - 1)
266266
]
267-
labels[-1] = f">{digits[-1]}"
267+
if units:
268+
labels[-1] = f">{digits[-1]} " + units
269+
else:
270+
labels[-1] = f">{digits[-1]}"
268271
return labels
269272

270273
kwargs.pop("labels", None)

0 commit comments

Comments
 (0)