How to use two colormaps in one imagesc plot?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
xw wang
am 2 Dez. 2020
Kommentiert: Ameer Hamza
am 2 Dez. 2020
I got a correlation map 50*50 with the data range [-0.8,1], I would like to plot the map using imagesc, and set the colormap based on the value range of each pixel, e.g for value >0 using 'hot' and for value<=0 using 'cool'. Is there a simple way to achieve this? Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 2 Dez. 2020
You can create a new colormap based on the proportion of the individual colormap
imagesc(M);
colorbar();
caxis([-0.8 1]);
cmap = [cool(80); hot(100)];
colormap(cmap);
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Blue finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!