PowerNorm runtime warning

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

PowerNorm runtime warning

Андрей Парамонов
Hello!

When running

import matplotlib.colors as colors
cmap = colors.PowerNorm(vmin = -1, vmax = 1, gamma = 3)
print(cmap(-1))
print(cmap(+0))
print(cmap(+1))

I expectedly get

0.0
0.125
1.0

However PowerNorm.autoscale* have

if self.vmin < 0:
    self.vmin = 0
    warnings.warn("Power-law scaling on negative values is ill-defined, clamping to 0.")

Why is it so? PowerNorm does work correctly for negative vmin!

Best wishes,
Andrey Paramonov

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users