Draw dashed isotherms
This commit is contained in:
parent
298bbe6357
commit
9e3c30f487
1 changed files with 11 additions and 1 deletions
|
@ -47,7 +47,7 @@ class SkewTGraph():
|
|||
return factor * self.height
|
||||
|
||||
def draw_isobars(self, cr: cairo.Context, x: float, y: float):
|
||||
cr.set_source_rgb(0.5, 0.5, 0.5)
|
||||
cr.save()
|
||||
|
||||
for pressure in range(PRESSURE_MIN, PRESSURE_MAX+1, PRESSURE_STEP):
|
||||
coord = self.graph_to_screen(-self.width / 2,
|
||||
|
@ -62,6 +62,8 @@ class SkewTGraph():
|
|||
cr.rel_line_to(self.width, 0)
|
||||
cr.stroke()
|
||||
|
||||
cr.restore()
|
||||
|
||||
def skew_t_to_graph(self, x: float, y: float):
|
||||
return (x+y, y)
|
||||
|
||||
|
@ -75,6 +77,12 @@ class SkewTGraph():
|
|||
return self.graph_to_screen(*self.sample_to_graph(temp, pressure))
|
||||
|
||||
def draw_isotherms(self, cr: cairo.Context, x: float, y: float):
|
||||
cr.save()
|
||||
|
||||
cr.set_source_rgb(0.5, 0.5, 0.5)
|
||||
cr.set_line_width(0.5)
|
||||
cr.set_dash([5, 5], 1)
|
||||
|
||||
for temp in range(-150, TEMP_MAX+1, TEMP_STEP):
|
||||
x1, y1 = self.sample_to_screen(temp, PRESSURE_MAX)
|
||||
x2, y2 = self.sample_to_screen(temp, PRESSURE_MIN)
|
||||
|
@ -88,6 +96,8 @@ class SkewTGraph():
|
|||
cr.line_to(x + x2, y + y2)
|
||||
cr.stroke()
|
||||
|
||||
cr.restore()
|
||||
|
||||
def draw_samples(self,
|
||||
cr: cairo.Context,
|
||||
x: float,
|
||||
|
|
Loading…
Add table
Reference in a new issue