I am trying to analyze graphically 2d data. matplotlib.imshow
very useful in this, but I feel that I can use it even more if I could exclude some cells from my matrix, values outside the range of interests. My problem is that these values “smooth out” the color set in my range of interests. I could have a higher color resolution after excluding these values.
I know how to apply a mask to my matrix to exclude these values, but after applying the mask, it returns a 1d object:
mask = (myMatrix > lowerBound) & (myMatrix < upperBound)
myMatrix = myMatrix[mask]
Is there a way to pass the mask in imshow
how to restore a 2d array?
source
share