diff --git a/lib/xmet/hodograph.py b/lib/xmet/hodograph.py index a2027ff..a14bd6f 100644 --- a/lib/xmet/hodograph.py +++ b/lib/xmet/hodograph.py @@ -289,7 +289,11 @@ class Hodograph(): cr.rectangle(offset + x, y + width * 1.5, width, width) cr.stroke() - text = "%dm" % (height) if height < 1000 else "%dkm" % (height /1000) + if height < 1000: + text = "%dm" % (height) + else: + text = "%dkm" % (int(height / 1000.0)) + extents = cr.text_extents(text) cr.move_to(offset + x - extents.width / 4, y + 3.5*width)