When using the units parameter in windrose.WindroseAxes.legend the bin for values above the highest specified bin value do not have the units displayed. For example here is simple image where the arbitrary units km do not display for >17.5.
Lines 249 - 268 in windrose.py handles the creation of the legend labels, including units. No extra handling is done for the last bin label.
def get_labels(decimal_places=1, units=None):
digits = np.copy(self._info["bins"]).tolist()
if not digits:
return ""
digits[-1] = digits[-2]
digits = [f"{label:.{decimal_places}f}" for label in digits]
fmt = "[{} : {}"
if locale.getlocale()[0] in ["fr_FR"]:
fmt += "["
else:
fmt += ")"
if units:
fmt += " " + units
labels = [
fmt.format(digits[k], digits[k + 1]) for k in range(len(digits) - 1)
]
labels[-1] = f">{digits[-1]}" # No extra handling for units
return labels
When using the
unitsparameter inwindrose.WindroseAxes.legendthe bin for values above the highest specified bin value do not have the units displayed. For example here is simple image where the arbitrary unitskmdo not display for>17.5.Lines 249 - 268 in
windrose.pyhandles the creation of the legend labels, including units. No extra handling is done for the last bin label.