bwinkel / pycraf

pycraf is a package that provides functions and procedures for various tasks in spectrum-management compatibility studies.
35 stars 15 forks source link

Matplotlib 3.3.3 -- 03c_attenuation_maps failing #37

Closed cbowers1020 closed 3 years ago

cbowers1020 commented 3 years ago

When running example notebook 03c_attenuation_maps, the color bar fails to render correctly with the proper tick placement, labels, and number of ticks. This occurs in code cell 8: ValueError: The number of FixedLocator locations (5), usually from a call to set_ticks, does not match the number of ticklabels (7).

I am using Matplotlib 3.3.3 on Ubuntu 18 in python 3.6.9.

cbowers1020 commented 3 years ago

The notebooks work under matplotlib 3.2.2

bwinkel commented 3 years ago

Thanks a lot for the hint. New matplotlib versions keep being maintenance heavy... I'll fix this in the next release.

cbowers1020 commented 3 years ago

I actually found the fix for this. It was painfully simple. The default vmax for the cim object was 950, but the colorbar was setting ticks up to 1350, so changing those to match (either one) fixed the problem.

That being said, it appears the pathprof wrapper function terrain_cmap_factory only takes an optional vmax argument but no vmin. This now causes a warning from matplotlib (attached). When using the color norm created for the terrain, matplotlib now wants vmin and vmax to be set when creating the norm. Screen Shot 2021-07-30 at 1 02 17 PM

bwinkel commented 3 years ago

Good to know. I stumbled upon the first problem myself recently, when I updated matplotlib. I'll take care of it asap.