Filter löschen
Filter löschen

Setting 3D plot's centre at origin

42 Ansichten (letzte 30 Tage)
PASUNURU SAI VINEETH
PASUNURU SAI VINEETH am 28 Aug. 2021
Kommentiert: Wan Ji am 29 Aug. 2021
Hey community, when I plot the 3D graph in a certain program, the intersection of X and Y axes wasn't present on the z=0 plane. I would like to know the command that forces the origin (0,0,0) to be the intersection of axes. I am sharing the plot command and the plot output.
plot3(x,y,z)
xlabel('x [m]')
ylabel('y [m]')
zlabel('z [m]')
grid

Antworten (1)

Wan Ji
Wan Ji am 28 Aug. 2021
try this
set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')
  2 Kommentare
PASUNURU SAI VINEETH
PASUNURU SAI VINEETH am 28 Aug. 2021
I am encountering the following error:
Error using matlab.graphics.axis.Axes/set
Unrecognized property ZAxisLocation for class Axes.
Error in Variable_Cd (line 97)
set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')
Wan Ji
Wan Ji am 29 Aug. 2021
So the only thing to do is
set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin')
And as for z-axis, can not be set to origin

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by