change x/y/z axis values in surf(X,Y,Z) plot
109 views (last 30 days)
Show older comments
Hello, I want to change the axis limits of a surf plot so that they correspond to actual values and not the dimension of the data matrix. Is it possible? I tried setting xlim (y and z as well) but the graph disappears. I use matlab R2017a. Thank you!
0 Comments
Answers (1)
KALYAN ACHARJYA
on 20 Jun 2019
Edited: KALYAN ACHARJYA
on 20 Jun 2019
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
surf(X,Y,Z)
xlim([0 21]);
ylim([1 10]);
zlim([0 50]);
Chosse the x,y,z range in such a way that plotin the range (within space), otherwise plot may be disappears.
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!