axis4animation

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-30, Last change: 2025-09-15

automatically increases but never decreases the axis area

Description

Call it once with intial parameters such as axis4animation([0 1 0 1]);

the use it before drawnowvid or drawnow

See Also: , axis4math , drawnowvid , axisratio , axisscale , axis4all

Example Illustration

 missing image of axis4animation(defax)

Syntax

nx=axis4animation([defax])

Input Parameter

defax: initial values to set

Output Parameter

nx: current axis values

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

Output Results

Algorithm Steps

  1. 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).
  2. The axis is then set to 'tight' using axis tight, which adjusts the axis limits to fit the data tightly.
  3. 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.
  4. The function then updates the nx variable, which holds the current axis values, by comparing and adjusting each limit:
  5. If ax has fewer elements than nx, the missing elements are filled from nx.
  6. If nx has more than four elements, the fifth and sixth elements are adjusted similarly:
  7. The global variable SGaxis4animation is updated with the new nx values.
  8. 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