Specify 3D axis origins to begin on the centre of surface plot ?
39 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a 3D surface plot of a sphere that i produced using a text file containing x, y, z coordinates.
However, currently the axis appears at the bottom of the sphere.
I was wondering if it is possible to move the origin [0,0,0] of the X, Y, Z axis to cross at the centre of the sphere ?
I have attached a screenshot of the current plot.
I am quite new to MATLAB so any help is appreciated. Thank you!
0 个评论
回答(2 个)
Image Analyst
2016-1-4
Try this:
[x, y, z] = ellipsoid(0,0,0,5.9,3.25,3.25,30);
figure
surf(x, y, z)
axis equal
xl = xlim()
yl = ylim()
zl = zlim()
hold on;
line(2*xl, [0,0], [0,0], 'LineWidth', 3, 'Color', 'k');
line([0,0], 2*yl, [0,0], 'LineWidth', 3, 'Color', 'k');
line([0,0], [0,0], 2*zl, 'LineWidth', 3, 'Color', 'k');
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!