From 60158d6f55e079a583c1b39677f1a39a81e54d21 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Mon, 24 Feb 2025 00:21:19 -0500 Subject: [PATCH] Set clipping region to snip isotherms --- lib/xmet/skew_t.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/xmet/skew_t.py b/lib/xmet/skew_t.py index dee40a3..045940c 100644 --- a/lib/xmet/skew_t.py +++ b/lib/xmet/skew_t.py @@ -68,7 +68,7 @@ class SkewT(): return self.skew_t_to_graph(x, y) def draw_isotherms(self, cr: cairo.Context, x: float, y: float): - cr.set_source_rgb(0.99, 0.99, 0.99) + 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)) @@ -115,6 +115,9 @@ class SkewT(): x: float, y: float, samples: Iterable[SoundingSample]): + cr.rectangle(x, y, self.width, self.height) + cr.clip() + self.draw_isotherms(cr, x, y) self.draw_isobars(cr, x, y)