NCAR/container-dtc-nwp

Python plots failing due to deprecated features

Closed this issue · 3 comments

Python plots are failing with this error:
/home/scripts/common/python/ALL_plot_allvars.py:314: DeprecationWarning: Please use gaussian_filter from the scipy.ndimage namespace, the scipy.ndimage.filters namespace is deprecated.

Fixed deprecated content. Ran into more errors:
ValueError: Passing parameters norm and vmin/vmax simultaneously is not supported. Please pass vmin/vmax directly to the norm when creating it.

Also, have to change 'Geopotential Height' --> 'Geopotential height.'

Because we specify clevs and use matplotlib.colors.BoundaryNorm, the use of vmin is unnecessary. Simply removing references to vmin removed error messages, and new plots look the same as old plots.

In addition, I removed ax1 = fig.add_axes([0.1,0.1,0.8,0.8]) --> this was causing a weird border around the plot.

I tested with the ALL_plot_allvars.py script as well as the individual plot_*.py scripts.

Note: These problems manifested themselves when upgrading to matplotlib 3.5.1 (which will be used in v4.0 release); this is a change from the v3.5.1 release, which used v3.3.4 of matplotlib.

Additional note: The Python scripts run, but they produce a warning. This warning has been present for releases, but at some point, we should address it:

/usr/local/lib/python3.8/site-packages/cartopy/mpl/geoaxes.py:1797: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.
result = matplotlib.axes.Axes.pcolormesh(self, *args, **kwargs)