0
votes

I am using imagesc to plot data sets of 16 matrices sized 256x1000 samples .each (data for one patient) I am using subplot to observe all the bi-dimensional plots at once. The max and min values of each of the matrices never match.

Then we close the program, open it again and run another batch of 16 matrices for other patient and so on..

We want that across all the patients and all the program runs, a particular color always represents the same value in the matrices , say 0.56 for yellow,

We have tried to use the version

imagesc(Cdata, clims)

where clims (stored in the program) are preset universal color limits assigned to the lower and upper color of the colormap, but this will rescale the colors in between, and we are not able to achieve a universal correspondence between a value and a particular color. For a patient 0.56 will be redish and for another patient/run it will be yellowish, which is not accepted in our case.

Many thanks in advance!

1
Hmm... It seems to me that imagesc(Cdata, clims) should work. Can you say more about the range of values for your data? How were the stored clims determined? I just tried: A=rand(10)+0.56; B=rand(10)-0.44; A(1)=0.56; B(1)=0.56; subplot(1,2,1);imagesc(A,[-1 1]);colorbar; subplot(1,2,2);imagesc(B,[-1 1]);colorbar; A and B have different max and min values, but the first entry is set to 0.56 in both. In the resulting images the first pixels are the same color. - Geoff

1 Answers

0
votes

Try using imshow instead of imagesc. It gives you much finer control over what you can do to the image.

Something like

imshow(Cdata, [-1, 1]);
colormap('jet');
colorbar();