문제

I am producing an imshow plot in Python.

In the final plot, I have strips/columns of data, between which there is no data at all - kind of like a barcode.

At the moment, where I have no data, I have just set all values to zero. The color of these regions of no data is therefore whatever colour represents zero in my colorbar - green in my case.

What I really want is for these columns/strips just to be white, and to make to really clear that these are regions of NO data.

I realise that I could change the colorbar so that the zero is white, but I really want to distinguish the regions of no data from any zeros that might be in the data.

Thank you.

도움이 되었습니까?

해결책

try setting those values to np.nan ( or float('nan')); you may also want to pass interpolation='nearest' to imshow as an argument.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top