Slight adjustment to heights legend
This commit is contained in:
parent
f562664ecf
commit
28a3200a47
1 changed files with 6 additions and 8 deletions
|
@ -174,7 +174,7 @@ class Hodograph():
|
|||
cr.save()
|
||||
cr.set_source_rgb(1, 1, 1)
|
||||
|
||||
cr.rectangle(offset + x - width / 2,
|
||||
cr.rectangle(offset + x - width * 0.75,
|
||||
y + width,
|
||||
interval * 4,
|
||||
width * 3)
|
||||
|
@ -182,7 +182,7 @@ class Hodograph():
|
|||
cr.fill()
|
||||
|
||||
cr.set_source_rgb(0.8, 0.8, 0.8)
|
||||
cr.rectangle(offset + x - width / 2,
|
||||
cr.rectangle(offset + x - width * 0.75,
|
||||
y + width,
|
||||
interval * 4,
|
||||
width * 3)
|
||||
|
@ -201,13 +201,11 @@ class Hodograph():
|
|||
cr.rectangle(offset + x, y + width * 1.5, width, width)
|
||||
cr.stroke()
|
||||
|
||||
cr.move_to(offset + x, y + 3.5*width)
|
||||
|
||||
if height < 1000:
|
||||
cr.show_text("%dm" % height)
|
||||
else:
|
||||
cr.show_text("%dkm" % (height / 1000))
|
||||
text = "%dm" % (height) if height < 1000 else "%dkm" % (height /1000)
|
||||
extents = cr.text_extents(text)
|
||||
|
||||
cr.move_to(offset + x - extents.width / 4, y + 3.5*width)
|
||||
cr.show_text(text)
|
||||
cr.stroke()
|
||||
|
||||
offset += interval
|
||||
|
|
Loading…
Add table
Reference in a new issue