필터 지우기
필터 지우기

2D plot with 3 var

조회 수: 1 (최근 30일)
Cristián Vera
Cristián Vera 2020년 1월 29일
댓글: Cristián Vera 2020년 2월 3일
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 :
muestra.jpg
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

채택된 답변

Walter Roberson
Walter Roberson 2020년 1월 29일
Pointsize=10;
scatter(x(:), y(:), Pointsize, z(:))
And you might need a call to colormap() to get the coloring you want.
  댓글 수: 1
Cristián Vera
Cristián Vera 2020년 2월 3일
Thank you so much.... I tried this but didnt use the Pointsize, that's why didnt work.
Thanks again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by