필터 지우기
필터 지우기

A "discrete" contour plot

조회 수: 5 (최근 30일)
Brooke
Brooke 2012년 4월 15일
If M(i,j) is a matrix,
How might I plot a contour plot where the (i,j) point on the x,y-plane has altitude M(i,j)?
What I did was
  x = 1:1:imax;
y = 1:1:jmax;
 
[x,y] = meshgrid(x,y);
z=M;
[c,h] = contour(x,y,z,100);
clabel(c,h,'manual');
But it doesn't seem to be right…
(If the plotting bit is right, then there must be something else the wrong with the program!)
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 4월 15일
It isn't a good idea to overwrite x and y with meshgrid(x,y), in the sense that it is confusing to the reader.

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

답변 (1개)

Wayne King
Wayne King 2012년 4월 15일
When you say "discrete" contour plot, do you mean something like
z = abs(round(peaks(5)));
bar3(z,0.3);
  댓글 수: 1
Brooke
Brooke 2012년 4월 15일
@Wayne: No, I just meant that the "data points" are given at discrete points. Sorry about the ambiguity... Nice bar chart, btw.

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

카테고리

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