diff --git a/lib/xmet/skew_t.py b/lib/xmet/skew_t.py index 7dd42b8..018f7d3 100644 --- a/lib/xmet/skew_t.py +++ b/lib/xmet/skew_t.py @@ -67,12 +67,15 @@ class SkewTGraph(): return self.skew_t_to_graph(x, y) + def sample_to_screen(self, temp: float, pressure: float): + return self.graph_to_screen(*self.sample_to_graph(temp, pressure)) + def draw_isotherms(self, cr: cairo.Context, x: float, y: float): cr.set_source_rgb(0.95, 0.95, 0.95) for temp in range(-150, TEMP_MAX+1, TEMP_STEP): - x1, y1 = self.graph_to_screen(*self.sample_to_graph(temp, PRESSURE_MAX)) - x2, y2 = self.graph_to_screen(*self.sample_to_graph(temp, PRESSURE_MIN)) + x1, y1 = self.sample_to_screen(temp, PRESSURE_MAX) + x2, y2 = self.sample_to_screen(temp, PRESSURE_MIN) cr.move_to(x + x1, y + y1) cr.line_to(x + x2, y + y2)