Using a heatmap to display a large value range with detail

I have a matrix composed of a very large data set around ~1000000 elements.
The problem I am facing is that the first half of elements have a tiny value, with the data displaying differences of 1.0E-9, but this data is quite important to the analysis. The second half have difference ranges of 1.0E-3 to 0.5.
I have attempted to plot a heatmap, image and surf graph of the data but am unable to get a resolution good enough to display specific.
Is there a way to display the data that I need? Such that even the smallest change in value is represented just as well as the larger changes?
I have attached the images generated.

 Akzeptierte Antwort

Youssef  Khmou
Youssef Khmou am 10 Feb. 2013
HI, suppose your final data is R , try to plot it in dB:
imagesc(10*log10(R));
surf(20*log10(R));
If there are elements that approach zero, you can try to Rescale by multiplying by 1E+3 per example and try again with to visualize in dB (20log10(rescaledR)).
I hope that helps,
Your heatmap is result of some calculations or importation ?

4 Kommentare

The heatmap is a result of calculations from software in Java, which is output to .data in a matrix format.
I then import this data to MatLab for analysis.
A new problem with taking the logarithm is that it introduces complex numbers and I cannot plot it. Is there a way around this?
Fayzan Ahmed
Fayzan Ahmed am 10 Feb. 2013
Bearbeitet: Fayzan Ahmed am 10 Feb. 2013
The reason is because negatives were in the matrix. This solution has helped massively. I have attached the new heatmap after taking a logarithm:
hi, ok good
It looks like a problem that i saw somewhere , is that heat diffusion using Navier Stokes equations? At the end you are concerned about Real values as result, ok let is try to work on that : As R is your matrix,
1-try to visualize the imaginary part :
imagesc(imag(10*log10(R)))
Is there any kind of symmetry between this and the real part?
2-try to visualize the modulus ( real®+imag®)^2 ) :
imagesc(abs(10*log10(R)))
and try to rescale the result by / or * by some factor .
If one theses suggestions work , try to surf the result, insert a legend and see if really the result is correct, per example the Red region must have an altitude of 400 Kelvin .
to be continued
Or you can try to Re-scale as "image Analyst" mentioned like the following :
factor=max(-R(:));
New_R=R+factor ;
%Visualization with log: now log will not produce C| values .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Image Analyst
Image Analyst am 10 Feb. 2013

0 Stimmen

One common way to handle this is to take the log of the data before you send it into surf(), image(), or imshow(). That will compress the higher values and expand the lower values, allowing you to see the structure of your data over a greater range.

1 Kommentar

Regarding your comment about taking the log and getting complex numbers. You can normalize your data to scale it between 1 and 100 so that you don't get values of 0 or less. The visualization should look virtually identical. You might want to look at mat2gray().

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Distribution Plots finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by