Contour plots in terms of 3 variables
Ältere Kommentare anzeigen
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 Kommentar
bym
am 12 Feb. 2012
perhaps you will want to investigate meshgrid()
Antworten (3)
the cyclist
am 10 Feb. 2012
0 Stimmen
Use the contour() function. Type "doc contour" into MATLAB for details.
5 Kommentare
Keith
am 12 Feb. 2012
the cyclist
am 13 Feb. 2012
There are different syntaxes for calling contour(), but in general it is expecting the Z input to be a matrix, with one value for each possible (x,y) combination. Here is a very simple prototype for the syntax:
x = 1:5;
y = (1:10)';
z = bsxfun(@times,y,x)
contour(x,y,z)
If your wind speeds and directions are on a regular grid, then you'll just need to reshape your Z values accordingly. If not, you might need to use TriScatteredInterp() to create the regular grid that contour() is expecting.
Keith
am 13 Feb. 2012
Keith
am 14 Feb. 2012
the cyclist
am 14 Feb. 2012
I think what you want is the colorbar command. Just run that command after your code.
Image Analyst
am 12 Feb. 2012
0 Stimmen
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
am 14 Feb. 2012
It sounds like you might be interested in a streamtube or streamribbon plot.
doc streamribbon
doc streamtube
Kategorien
Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!