필터 지우기
필터 지우기

How can I plot the values of a vector in colors: 2d position plot plus color.

조회 수: 6 (최근 30일)
Hi,
I would like to plot a position (standard 2D plot with X and Y corresponding to logitude and latitude values) and color the resulting line according to the values of a third vector (that represent temperature). All vector have the same lenght. Any advice on how to do it?
More Details:
I have three vectors. For example:
longitude=[52,50,60]
latitude=[10,15,20]
temp=[20,18,24]
I would like to have a 2D plot with a line give by the vectors longitude and latitude and the color of the line given by the vector temp.
Thanks in advance :)
  댓글 수: 1
Ruger28
Ruger28 2020년 5월 26일
편집: Ruger28 2020년 5월 26일
a scatter could easily accompolish this. x and y are lat and long, and temp would be the c. The sz is whatever you want. I suggest start with 50 or 100. You can tweak it as desired.
scatter(x,y,sz,c)

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

채택된 답변

KSSV
KSSV 2020년 5월 26일
Read about scatter.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by