Info

此问题已关闭。 请重新打开它进行编辑或回答。

is there a way to fix the color axis so that similar data values take up similar color values even if the data range has changed ?

1 次查看(过去 30 天)
Hi, I have a query regarding subplots and mapping values onto colormap (gray). I have a set of 2D matrices with different minimum and maximum values for each. I would like to subplot these different matrices using imagesc but scale them all with respect to a global maximum and minimum. So if a subplot is noisy it would have colors close to black i.e. 0. This way I can differentiate good data from noisy ones straight away. I have tried using caxis with fixed values corresponding to global max and min but it doesn't seem to do the job. I am wondering if there is a way to fix a color to a particular data value irrespective of the data range. Thanks in advance, Stanley

回答(2 个)

Walter Roberson
Walter Roberson 2011-9-28

Image Analyst
Image Analyst 2011-9-28
You can use imshow() instead of imagesc and if you do that you can set the scaling upper and lower limits yourself. imagesc determines them from your data so it will be different for all of them. You can use whatever colormap you want - all of them will use that colormap and each color will correspond to a certain value no matter what axes it's in or what the range of data in that axes is.

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by