You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UxDataArray.plot() should squeeze(), to support extra dimensions with size 1 #1724
To follow xarray behavior, UxDataArray.plot() should call squeeze() automatically, while calling specific plotting methods like UxDataArray.plot.polygons() should not.
Checking help(xr.DataArray.plot) clarifies: Calls xarray plotting function based on the dimensions of the squeezed DataArray.
Here is a simple demonstration:
Above, (A) and (D) are equivalent; x.plot() dispatches to x.plot.line() because x is 1D. Meanwhile, (B) and (C) are equivalent as per the clarification above; thing.plot() is equivalent to thing.squeeze().plot(). Finally, (E) shows that calling a specific method directly does not automatically apply squeeze().
Actually, after talking through it during internal discussion today, the team decided to instead go with always squeezing away any size 1 non-grid extra dimensions for all plotting methods (at least, for all existing plotting methods). #1812 will include this squeezing for the new contour plots feature). This means that closing this issue will require adding this squeezing to all existing plotting methods, not just to arr.plot().
Activity
Sevans711 commentedon Oct 22, 2026
Actually, after talking through it during internal discussion today, the team decided to instead go with always squeezing away any size 1 non-grid extra dimensions for all plotting methods (at least, for all existing plotting methods). #1812 will include this squeezing for the new contour plots feature). This means that closing this issue will require adding this squeezing to all existing plotting methods, not just to
arr.plot().