Figure display issue 'colormap(gray)'

Hi
I have created a figure by using following code. The figure attached here. I have chose colormap(gray) and surprised why the background gray color in subplot(1,3,3) is different.
figure(1),
subplot(1,3,1);
imagesc(Shot);
color=caxis; caxis(color*.005);
colormap(gray);
subplot(1,3,2);
imagesc(Shot0);
color=caxis; caxis(color*.005);
colormap(gray);
subplot(1,3,3);
imagesc(Shot_sub);
color=caxis; %caxis(color*.005);
colormap(gray);

Réponses (1)

Walter Roberson
Walter Roberson le 20 Fév 2021

0 votes

You are not doing the caxis(color*.005) in the last one.
When you do imagesc(), caxis should automatically become the range of values present in the data.
When you caxis() 0.005 times that range, you really restrict the range of mapping. If your data is positive, much of the data will turn white, unless your distribution is badly skewed (a possibility.)
In the last of the plots, you do not restrict the range to 1/200 of the value of the data, so if the data is positive, it is not going to be brightened as much as the others.

7 commentaires

Nisar Ahmed
Nisar Ahmed le 21 Fév 2021
Hi Roberson,
Thank for the detail answer. See in the attached figure, when I added caxis(color*.005) in the last one how it appears (far from actual figure) but the background color still dark. How I can overcome this issue?
Please see another attached figure.
Image Analyst
Image Analyst le 21 Fév 2021
Perhaps you would want to use imadjust() to make the image more pleasing for display.
Walter Roberson
Walter Roberson le 21 Fév 2021
Can you attach the image data for testing?
Nisar Ahmed
Nisar Ahmed le 21 Fév 2021
Hi Roberson,
I tried to upload data but faild as I am using tp plot a data with extention .rss.
[Shot_sub] = (ReadRSS('Pshot_sub.rss'))
Walter Roberson
Walter Roberson le 21 Fév 2021
can you attach the rss file? you will need to zip it up and attach the zip
Nisar Ahmed
Nisar Ahmed le 22 Fév 2021
I tried to zip it but again size is around 12 MB (gearter than 5 MB size limit) so unable to load.
Walter Roberson
Walter Roberson le 22 Fév 2021
put it up on dropbox and post the link?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by