I found an answer for the last question. The last three rows are the colours for data low and high out-of-range values and for masked values.
Meaning of the colormap._lut list in matplotlib.color
-
23-06-2022 - |
Question
If I understood well, a colormap is an object which fixes a map from a set of numbers to colors.This map can be summarized by using the "lut". To see the "lut" associated to a cmap
you have to call cmap._init()
, then you can see the cmap._lut
What does it mean? Isn't the Lut an attribute of any cmap object? What does precisely do the ._init()
?.
The Lut is made up of N+3 rows and 4 columns where N is the number of colours of the cmap.
The first N rows are the RGBA representation of the corresponding colours. What are the last
three rows? What do they represent?
I hope my questions are not too stupid. Thanks!
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow