Skip to content

Commit

Permalink
fix issues with multi time coords
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson authored Jun 3, 2024
1 parent 4c4cae5 commit 266b2c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ncplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,15 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):

coord_list = list(ds.coords)


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)

coord_list = list(ds.coords)

coord_list = [x for x in coord_list if x in list(ds.dims)]
Expand Down

0 comments on commit 266b2c3

Please sign in to comment.