필터 지우기
필터 지우기

Plotting problem & Does the matlab can plot raster map?

조회 수: 2 (최근 30일)
ZC Song
ZC Song 2019년 6월 4일
댓글: ZC Song 2019년 6월 4일
I have coordinates (X,Y) and its corresponding value (Z), How to visualize them and distinguish with different color for each point? Just like a raster file that every pixel has a value in it.
Thank you very much!
  댓글 수: 2
KSSV
KSSV 2019년 6월 4일
편집: KSSV 2019년 6월 4일
It is not a raster data. These are scattered points.
ZC Song
ZC Song 2019년 6월 4일
So could you give me a hint that how to transfer those data to raster format?

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

채택된 답변

KSSV
KSSV 2019년 6월 4일
편집: KSSV 2019년 6월 4일
Let X,Y,Z be your m*3 data.
x = unique(X) ; nx = length(x) ;
y = unique(X) ; ny = length(y) ;
X = reshape(X,nx,ny) ;
Y = reshape(Y,nx,ny) ;
Z = reshape(Z,nx,ny) ;
figure
pcolor(X,Y,Z)
shading interp
figure
surf(X,Y,Z)
shading interp
  댓글 수: 9
KSSV
KSSV 2019년 6월 4일
YOu have only two values in Z 0 and 1. You can plot them like below:
scatter(X(Z==1),Y(Z==1),'s','filled','r')
hold on
scatter(X(Z==0),Y(Z==0),'s','filled','b')
ZC Song
ZC Song 2019년 6월 4일
Great! it works!
Thank you very much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by