Search code examples
pythonmatplotlib

Alternative to Matplotlib.colors.DivergingNorm


1 - What is the alternative to Matplotlib.colors.DivergingNorm that has been deprecated since Matplotlib 2.3.1?

2 - I still get AttributeError: module 'matplotlib.colors' has no attribute 'DivergingNorm', even though I am using Matplotlib version 2.2.4. Why?

Thank you!


Solution

  • This doesn't answer the question for 2.2.4, but for the benefit of anyone who comes across this looking for the current (3.2.0) alternative: it is now matplotlib.colors.TwoSlopeNorm, the usage and documentation are identical to the matplotlib.colors.DivergingNorm from 3.1.0.