I am trying to analyse graphically 2d data. matplotlib.imshow
is very useful in that but I feel that I could make even more use of that if I could exclude some cells from my matrix, values of outside of a range of interest. My problem is that these values ''flatten'' the colormap in my range of interest. I could have more color resolution after excluding these values.
I know how to apply a mask on my matrix to exclude these values, but it returns a 1d object after applying the mask:
mask = (myMatrix > lowerBound) & (myMatrix < upperBound)
myMatrix = myMatrix[mask] #returns a 1d array :(
Is there a way to pass the mask to imshow
how to reconstruct a 2d array?