How can i set color range in 2D plot?

12 vues (au cours des 30 derniers jours)
SWAGATA BHUNIA
SWAGATA BHUNIA le 21 Mai 2016
I am getting 2D plot by using imagesc(..,z) command but here i need white color for lower value of Z(z is a 2*2 matrix) means if my z_max 1000, then below 50 i want to get white color. How can i do this?
  1 commentaire
SWAGATA BHUNIA
SWAGATA BHUNIA le 21 Mai 2016
Sorry, my Z is n*n matrix.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 21 Mai 2016
z_cutoff = 50;
cmap = colormap();
cmap(1,:) = [1 1 1]; %white
colormap(cmap);
zmax = max(z(:));
caxis([z_cutoff, zmax]);

Catégories

En savoir plus sur Color and Styling dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by