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
nx=axis4animation([defax])
defax: | initial values to set |
nx: | current axis values |
axis4animation([0 1 0 1]);
for i=steps
delete(h);
h=[h;PSplot(PLtransT(CPLE,TL0(:,:,i)),colofPose('E'))];
axis4animation
drawnowvid;
end
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.
defax is provided. If so, it sets the global variable SGaxis4animation to these values and applies them to the current axis using axis(defax).axis tight, which adjusts the axis limits to fit the data tightly.ax=axis. If the global variable SGaxis4animation has fewer elements than ax, it is updated to match ax.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).ax has fewer elements than nx, the missing elements are filled from nx.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).SGaxis4animation is updated with the new nx values.axis auto, and then the new axis limits are applied using axis(nx).