How to get brighter colors in a colormap?

13 vues (au cours des 30 derniers jours)
Sim
Sim le 1 Fév 2021
Modifié(e) : Sim le 1 Fév 2021
Hi, I would like to change the three colors in the bluewhitered colormap, i.e. red, white and blue into fuchsia, silver and emerald green:
rgb('fuchsia','silver','emerald green')
To do so I should change the colors in the bluewhitered function:
bottom = [0 0 0.5]; % blue
botmiddle = [0 0.5 1];
middle = [1 1 1]; % white
topmiddle = [1 0 0];
top = [0.5 0 0]; % red
into:
bottom = [0.929411764705882 0.0509803921568627 0.850980392156863]; % fuchsia
botmiddle = ?
middle = [0.772549019607843 0.788235294117647 0.780392156862745]; % silver
topmiddle = ?
top = [0.00784313725490196 0.56078431372549 0.117647058823529]; % emerald green
but how can I change the brighter ones?, i.e.:
botmiddle = ?
topmiddle = ?
  1 commentaire
Sim
Sim le 1 Fév 2021
Modifié(e) : Sim le 1 Fév 2021
Thanks a lot to @Walter Roberson! But - just by curiosity - in case anyone could also give me the values for
botmiddle = ?
topmiddle = ?
I would be grateful :)

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Fév 2021
  1 commentaire
Sim
Sim le 1 Fév 2021
Modifié(e) : Sim le 1 Fév 2021
Thanks a lot, Custom Colormap looks working for my case:
mycolormap = customcolormap([0 0.5 1], rgb('fuchsia','silver','emerald green'));
colormap(mycolormap)
colorbar
Note: It looks working also with quantities - that you want to show with the colormap - which have both positive and negative values, and still using a positive range
[0 0.5 1]
in the command
customcolormap([0 0.5 1], ...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Red 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