scale x,y and z axis to match JPL Database

1 次查看(过去 30 天)
I am using the NASA JPL Databases and learning how to plot the Three-Body Periodic Orbits using ode45 and my own derivate function. I was wondering if anyone knows how to scale the x,y and z axis to fit in with the JPL Databases. https://ssd.jpl.nasa.gov/tools/periodic_orbits.html

回答(1 个)

Arnav
Arnav 2024-9-4
Hi @kim,
Based on my understanding, you wish to scale the ranges of all three axes to be same and set limits of the plots such that the whole figure is visible.
The maximum range of the data can be calculated by using the max function as:
max_range = max([max(abs(X)), max(abs(Y)), max(abs(Z))]);
Then, after plotting the data you can set the limits for the axes by using the axis function as:
axis([-max_range, max_range, -max_range, max_range, -max_range, max_range]);
axis equal;
You may refer to the documentation page of axis for more information : https://www.mathworks.com/help/matlab/ref/axis.html#responsive_offcanvas

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by