From 2b466b83be5d725bfd176ed550e2706cce566a8b Mon Sep 17 00:00:00 2001 From: Robert Wilson Date: Mon, 3 Jun 2024 15:33:23 +0100 Subject: [PATCH] fix multi-time coord issue --- ncplot/plot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ncplot/plot.py b/ncplot/plot.py index 26f06b0..72b3607 100644 --- a/ncplot/plot.py +++ b/ncplot/plot.py @@ -247,12 +247,11 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs): coord_list = list(ds.coords) - #if vars is None: - #vars = [x for x in list(ds.data_vars) if x not in coord_list] - - for cc in coord_list: + new_coords = list(ds.coords) + if cc not in new_coords: + continue if len(ds[cc].values.ravel()) <= 1: if cc in list(ds.dims): ds = ds.squeeze(cc, drop=True)