Create a colormap for scatter3
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Nuno
am 18 Jun. 2015
Beantwortet: Star Strider
am 19 Jun. 2015
Hello!
I have this code:
m = 161;
map = zeros(m , 3);
T = [120, 120, 120 % dark
1, 0, 0 % brown
255, 105, 180 % pink
255, 255, 255 % white
255, 255, 255]./255; % white
x = [0
50
120
160
255];
map = interp1(x/255,T,linspace(0,1,255));
I = linspace(0,1,255);
imagesc(I(ones(1,10),:)')
colormap(map)
How i change this colormap for green/yellow and red?
Thanks
0 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Jun. 2015
This works:
T = [0,1,0; 1,1,0; 1,0,0]; % Green - Yellow - Red
T = interp1([1:3]', T, linspace(1, 3, 5)');
m = 161;
map = zeros(m , 3);
x = [0
50
120
160
255];
map = interp1(x/255,T,linspace(0,1,255));
I = linspace(0,1,255);
imagesc(I(ones(1,10),:)')
colormap(map)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Color and Styling 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!