Contour plots in terms of 3 variables

조회 수: 1 (최근 30일)
Keith
Keith 2012년 2월 10일
편집: Roger Stafford 2013년 10월 10일
Hi all - I hope someone can help me.
I have three data sets:
  • wind speed
  • wind direction
  • error.
What I'd like to do is to create a contour plot that shows values of error in terms of the wind speed and direction - in so far that the diagram will illustrate where the greater values of error are with respect to both wind speeds and direction. Can any one help??
  댓글 수: 1
bym
bym 2012년 2월 12일
perhaps you will want to investigate meshgrid()

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

답변 (3개)

the cyclist
the cyclist 2012년 2월 10일
Use the contour() function. Type "doc contour" into MATLAB for details.
  댓글 수: 5
Keith
Keith 2012년 2월 14일
Hi cyclist - that appears to work - although to be honest, it doesn't produce the contoured illustration I desire. The code::
load Error_No_Filter.txt
X=Error_No_Filter(:,1)
Y=Error_No_Filter(:,2)
Z=Error_No_Filter(:,3)
F.Method = 'nearest';
F = TriScatteredInterp(X, Y, Z);
x_axis = 0:1:15;
y_axis = 0:10:360;
[qx,qy] = meshgrid(x_axis,y_axis);
qz = F(qx,qy);
mesh(qx,qy,qz); hold on; contour3(X,Y,Z);
xlabel('Wind Speed [m/s]', 'fontweight','b'), ylabel('Wind Direction [deg]','fontweight','b')
zlabel('error', 'fontweight','b')
title('Interpolated error in terms of wind speed & direction', 'fontweight','b');
From the above, do you have any suggestions that can facilitate turning the above into a contour illlustration that also illustrates the values of the associated cotours?
Thanks,
KEith
the cyclist
the cyclist 2012년 2월 14일
I think what you want is the colorbar command. Just run that command after your code.

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


Image Analyst
Image Analyst 2012년 2월 12일
Why not use TriScatteredInterp() to turn your set of (x,y,z) triplets into an image, and display it as an image? That would probably be an insightful visualization and allow you to see patterns. Or you can do a surface plot. There's a nice demo for that in the help for TriScatteredInterp().

Sean de Wolski
Sean de Wolski 2012년 2월 14일
It sounds like you might be interested in a streamtube or streamribbon plot.
doc streamribbon
doc streamtube

카테고리

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