scale x,y and z axis to match JPL Database

조회 수: 1 (최근 30일)
kim
kim 2024년 7월 22일
답변: Arnav 2024년 9월 4일
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