2D plot with 3 var
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Cristián Vera
am 29 Jan. 2020
Kommentiert: Cristián Vera
am 3 Feb. 2020
Hi!
I have 3 vars:
x: Position x of the particle
y: Position y of the particle
v: Velocity of the particle
So... If I plot:
plot(x,y,'.')
I have this :
I need the same plot but the colors of each point in a color related to the velocity.... For example the points where the velocity is high red and the points where the velocity is low, blue. Hope it's understood.
How can I do this?
PS: In the plot there are 7200 particles
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 29 Jan. 2020
Pointsize=10;
scatter(x(:), y(:), Pointsize, z(:))
And you might need a call to colormap() to get the coloring you want.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots 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!