wind vector arrows color coding
Mostrar comentarios más antiguos
Hi i have data of wind direction , speed, and temperature.
wdir = [45 90 90];
knots = [6 6 8 ];
temp=[10 5 -2];
Using the following lines i can get the compass plot for wind direction and speed.
rdir = wdir * pi/180;
[x,y] = pol2cart(rdir,knots);
compass(x,y);
But is there any way to color code the arrows using the temp values, and give the legend of the temp color code. Seeking help from matlab experts, Thanks in advance.
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 14 de Feb. de 2014
wdir = [45 90 90];
knots = [6 6 8 ];
temp=[10 5 -2];
rdir = wdir * pi/180;
[x,y] = pol2cart(rdir,knots);
h=compass(x,y);
set(h(1),'color','r')
set(h(2),'color','b')
set(h(3),'color','g')
legend({'h1' 'h2' 'h3'})
Categorías
Más información sobre Vector Fields en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!