
Specify 3D axis origins to begin on the centre of surface plot ?
33 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Image Analyst
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!