
Specify 3D axis origins to begin on the centre of surface plot ?
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Image Analyst
le 4 Jan 2016
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 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!