From 298bbe6357617ed51e6a45dc91369e43dcc2945c Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Mon, 24 Feb 2025 11:48:02 -0500 Subject: [PATCH] Shift isobar legends down by 50mb --- lib/xmet/skew_t.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/xmet/skew_t.py b/lib/xmet/skew_t.py index a7e6915..fcdf5c6 100644 --- a/lib/xmet/skew_t.py +++ b/lib/xmet/skew_t.py @@ -53,7 +53,11 @@ class SkewTGraph(): coord = self.graph_to_screen(-self.width / 2, self.pressure_to_y(pressure)) - cr.set_source_rgba(0, 0, 0, 0.5) + if pressure % (2*PRESSURE_STEP) == 0: + cr.set_source_rgb(0.35, 0.35, 0.35) + else: + cr.set_source_rgb(0.75, 0.75, 0.75) + cr.move_to(x + coord[0], y + coord[1]) cr.rel_line_to(self.width, 0) cr.stroke() @@ -71,12 +75,15 @@ 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.set_source_rgb(0.95, 0.95, 0.95) - 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) + if temp % (2*TEMP_STEP) == 0: + cr.set_source_rgb(0.35, 0.35, 0.35) + else: + cr.set_source_rgb(0.75, 0.75, 0.75) + cr.move_to(x + x1, y + y1) cr.line_to(x + x2, y + y2) cr.stroke() @@ -169,7 +176,7 @@ class SkewTLegend(): skew_t: SkewTGraph, x: float, y: float): - for pressure in range(PRESSURE_MAX, PRESSURE_MIN-1, -2*PRESSURE_STEP): + for pressure in range(PRESSURE_MAX-PRESSURE_STEP, PRESSURE_MIN-PRESSURE_STEP-1, -2*PRESSURE_STEP): x_rel = skew_t.width y_rel = skew_t.height - skew_t.pressure_to_y(pressure)