Hi I was trying to run a plotting code after about 6 months, and some of the modules/functions cannot be imported anymore. I checked online and saw the following example in the matplotlib page: matplotlib.colors.TwoSlopeNorm — Matplotlib 3.5.3 documentation
It seems to give error ‘module’ object has no attribute ‘TwoSlopeNorm’
I would appreciate any directions on solving this error.
Thank you and best regards,
Example:
import matplotlib.colors as mcolors
offset = mcolors.TwoSlopeNorm(vmin=-4000.,
vcenter=0., vmax=10000)
data = [-4000., -2000., 0., 2500., 5000., 7500., 10000.]
offset(data)
array([0., 0.25, 0.5, 0.625, 0.75, 0.875, 1.0])