scatterm with scatter marker pink to red color based on values

5 vues (au cours des 30 derniers jours)
Vesp
Vesp le 29 Juil 2016
Hello,
Based on another post I have been able to find how create a scatter map with marker size and color based on the data value, but I would like to change the colors to range from light pink to dark red so lump the lower values into pink medium into red and large values into dark red. I have not been able to figure out how to do this. I would appreciate any help, thank you.
This is what I have so far where the colors range from blue to red.
scatterm(lat20,lon20,z20*10,z20,'filled')
  1 commentaire
Vesp
Vesp le 29 Juil 2016
Update: I tried the following, but I am getting an error message about scatterm format being incorrect.
C=[1;0.713725;0.756863;1;0;0;0.545098;0;0];
scatterm(lat20,lon20,z20*10,C,'filled');

Connectez-vous pour commenter.

Réponses (1)

Chad Greene
Chad Greene le 31 Juil 2016
You're close. The scatter and scatterm functions link colors to the current colormap of the figure. So you'll have to set the colormap. Using my rgb function it's pretty straightforward:
scatter(rand(100,1),rand(100,1),50,rand(100,1),'filled');
colormap(rgb('light pink','medium pink','dark red'))

Catégories

En savoir plus sur White dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by