How to change color of colorbar's lower minimum value?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tunechi
il 16 Ott 2014
Commentato: Star Strider
il 17 Ott 2014
How can I change the minimum value color on the color bar? I'm getting white color for the lower values.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/145742/image.png)
imagesc(x,y,value)
set(gca,'YDir','normal')
myColorMap = colormap;
myColorMap(1,:) = [1 1 1];
colormap(myColorMap);
colorbar;
ma=max(value);
mi=min(value);
0 Commenti
Risposta accettata
Star Strider
il 16 Ott 2014
You are getting a white color for the lower values because you defined:
myColorMap(1,:) = [1 1 1];
11 Commenti
Image Analyst
il 17 Ott 2014
Why does your image have nan's in it anyway? What color do you want the nan's to appear as? I think an axes control might have a background or foreground color that appears if the pixels are nan's (so they mgiht be "transparent") but I'd have to check on that. I never deal with images that have nan's. Why do you have them?
Star Strider
il 17 Ott 2014
Tunechi — My pleasure!
I A — That’s new. I didn’t know about imagesc until now. I used contourf in my example.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Colormaps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!