Compare commits
No commits in common. "a5758646da8e5db98296c3a36140966a5c1df268" and "eda84fa990d7f94247fc6c36351cb087217c43ea" have entirely different histories.
a5758646da
...
eda84fa990
1 changed files with 11 additions and 17 deletions
|
@ -49,27 +49,21 @@ class SkewTGraph():
|
|||
|
||||
return factor * self.height
|
||||
|
||||
def draw_isobar(self, cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
pressure: float):
|
||||
sx, sy = self.graph_to_screen(-self.width / 2,
|
||||
self.pressure_to_y(pressure))
|
||||
|
||||
cr.move_to(x + sx, y + sy)
|
||||
cr.rel_line_to(self.width, 0)
|
||||
cr.stroke()
|
||||
|
||||
def draw_isobars(self, cr: cairo.Context, x: float, y: float):
|
||||
cr.save()
|
||||
|
||||
cr.set_source_rgb(0.75, 0.75, 0.75)
|
||||
|
||||
for pressure in range(PRESSURE_MIN, PRESSURE_MAX+1, PRESSURE_STEP):
|
||||
coords = self.graph_to_screen(-self.width / 2,
|
||||
self.pressure_to_y(pressure))
|
||||
|
||||
if pressure % (2*PRESSURE_STEP) != 0:
|
||||
continue
|
||||
|
||||
self.draw_isobar(cr, x, y, pressure)
|
||||
cr.move_to(x + coords[0], y + coords[1])
|
||||
cr.rel_line_to(self.width, 0)
|
||||
cr.stroke()
|
||||
|
||||
cr.restore()
|
||||
|
||||
|
@ -169,11 +163,11 @@ class SkewTGraph():
|
|||
cr.stroke()
|
||||
|
||||
def draw_sounding(self,
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
sounding: Sounding,
|
||||
fn: Callable):
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
y: float,
|
||||
sounding: Sounding,
|
||||
fn: Callable):
|
||||
cr.save()
|
||||
|
||||
first = True
|
||||
|
|
Loading…
Add table
Reference in a new issue