I think I'm missing something simple here. I'm running this code:
fig = figure;
ax = axes('Parent',fig);
ax.DataAspectRatio = [1 1 1];
ax.XGrid = 'On';
ax.YGrid = 'On';
ax.ZGrid = 'On';
ylabel('y-axis');
zlabel('z-axis');
xlabel('x-axis');
view(3);
[x, y, z] = sphere;
surf(ax, x, y, z);
As indicated in the comments, the "surf" command seems to be overriding my axis properties for some reason. If I check the axis object, the properties are still there (ie, calling ax.DataAspectRatio will show [1 1 1], but on the viewable plot, the aspect ratio changes).
Thanks.
2 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/499317-surf-overwrites-axis-properties#comment_783846
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/499317-surf-overwrites-axis-properties#comment_783846
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/499317-surf-overwrites-axis-properties#comment_783859
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/499317-surf-overwrites-axis-properties#comment_783859
Sign in to comment.