Syntax
nx=axis4animation([defax])
Input Parameter
defax : | | initial values to set |
Output Parameter
Examples
axis4animation([0 1 0 1]);
for i=steps
delete(h);
h=[h;PSplot(PLtransT(CPLE,TL0(:,:,i)),colofPose('E'))];
axis4animation
drawnowvid;
end
Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, axis4animation
, is designed to automatically adjust the axis limits for animations, ensuring that the axis area can increase but never decrease. It is part of the SolidGeometry library and is used in visualization tasks.
Input Parameters
- defax: Initial axis values to set. This is an optional parameter that defines the starting axis limits.
Output Results
- nx: The current axis values after adjustment.
Algorithm Steps
- The function begins by checking if the input parameter
defax
is provided. If so, it sets the global variable SGaxis4animation
to these values and applies them to the current axis using axis(defax)
.
- The axis is then set to 'tight' using
axis tight
, which adjusts the axis limits to fit the data tightly.
- The current axis limits are retrieved using
ax=axis
. If the global variable SGaxis4animation
has fewer elements than ax
, it is updated to match ax
.
- The function then updates the
nx
variable, which holds the current axis values, by comparing and adjusting each limit:
nx(1)
is set to the minimum of nx(1)
and ax(1)
.
nx(3)
is set to the minimum of nx(3)
and ax(3)
.
nx(2)
is set to the maximum of nx(2)
and ax(2)
.
nx(4)
is set to the maximum of nx(4)
and ax(4)
.
- If
ax
has fewer elements than nx
, the missing elements are filled from nx
.
- If
nx
has more than four elements, the fifth and sixth elements are adjusted similarly:
nx(5)
is set to the minimum of nx(5)
and ax(5)
.
nx(6)
is set to the maximum of nx(6)
and ax(6)
.
- The global variable
SGaxis4animation
is updated with the new nx
values.
- The axis is set to 'auto' using
axis auto
, and then the new axis limits are applied using axis(nx)
.
Algorithm explaination created using ChatGPT on 2025-08-19 07:55. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21