How can I plot a 2D contour from data vectors?

조회 수: 3 (최근 30일)
Schneider Eusse
Schneider Eusse 2013년 8월 18일
Hi,
I have 3 column vectors PosX, PosY and T; all of size 1367 1
I want to plot 2d contour where:
X axis be defined by PosX
Y axis be defined by PosY
and Z axis be a colormap of T
An exmaple of my data:
PosX(5,1)=24.5;
PosY(5,1)=-0.5;
T(5,1)=1220;
These 3 values must represent a point of my plot.
Thanks for your help.

답변 (1개)

Image Analyst
Image Analyst 2013년 8월 18일
I think you mean T is the value for the (x,y) coordinate, not a colormap. But you want a colormap to be applied to the T values.
Do you just want to plot the data, like with plot3(),
plot3(X(:), Y(:), T(:));
or do you want level contours that might go in between any data that you have?
  댓글 수: 2
Schneider Eusse
Schneider Eusse 2013년 8월 18일
Correct, T is the value for the (x,y) coordinate, but T is not a function, i have these data as vectors (was calculated by element finite method). I want a colormap to be applied to the T values.
I got an answer using plot3(), but it is not what I need. I need only a 2d view and a colormap to the T values. how i do it?
Thanks a lot. P.D.: Excuse my bad english.
Image Analyst
Image Analyst 2013년 8월 18일
Maybe you should turn it into a full 2D array and then use contour(). You can use TriScatteredInterp or scatteredInterpolant to do this. This will give you a value for T for every possible pair of x and y - essentially a solid 2D array (like an image).

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by