Error Using Surface Plot
9 views (last 30 days)
Show older comments
Trying to make a three dimensional plot, with the third array being a function of the first two (long,lat,altitude for example).
To try get the syntax right, I am using a practice script.
Why would using the surf function following meshgrid on three variables not work?
q = [1:.1:15];
w = [1:.1:15];
zz = [1:.1:15];
[Q, W, ZZ] = meshgrid(q,w,zz);
figure(2)
surf(Q,W,ZZ)
colorbar
0 Comments
Answers (1)
Walter Roberson
on 2 May 2017
Your Q, W, and ZZ variables are going to be 3D because you are using meshgrid() on 3 inputs.
The three inputs to surf() need to be 2D.
surf() cannot be used to create volume plots.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!