PollyNET / Pollynet_Processing_Chain

NRT lidar data processing program for multiwavelength polarization Raman lidar network (PollyNET)
https://polly.tropos.de/
GNU General Public License v3.0
20 stars 8 forks source link

plotting needs update #69

Closed HolgerPollyNet closed 4 years ago

HolgerPollyNet commented 4 years ago

Warniung message for many plotting ##routines:

MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later.

ZPYin commented 4 years ago

Such warnings were caused by the upgrade of matplotlib to version >=3.3.x. In previous versions, pcolormesh does not throw warnings when X, Y match the shape of Z in the flat shading mode, in which X, Y need to have 1-element more than the respetive dimension of Z. Instead, matplotlib will remove the last row/column of Z to fullfil the requirement of shading. (see the image below)

image

To eliminate such annoying warnings, we can either change the shading mode from flag (default) to nearest, where matplotlib will center the colored quadrilaterals on the grid points. (see the image below)

image

Or freeze the version of matplotlib to version < 3.3.x.

To make it more user-friendly, I chose the former one. Such fix has been implemented in commit: dbb571b43b86

Reference

  1. https://matplotlib.org/3.3.0/gallery/images_contours_and_fields/pcolormesh_grids.html