axis4all

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

applies the commands for axis to all subplots applies the commands for axis to all subplots



See Also: axisscale , view4all

Example Illustration

 missing image of axis4all(fig,axisparams)

Syntax

axis4all([fig,axisparams])

Input Parameter

fig: default is gcf; no need to use it as first paramter
axisparams: list of parameters same as for axis

Examples


close all
SGsample; % or SGfigure; SGplot4(SGbox)
axisscale
axis4all('on','tight'); drawnow
axis4all(gcf, 'off'); drawnow





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 algorithm is a MATLAB function named axis4all that applies axis settings to all subplots within a specified figure. It is part of the SolidGeometry library and was introduced in version 5.2.

Input Parameters

Algorithm Steps

  1. The function begins by determining the figure to operate on. It uses a helper function getfuncparams to retrieve the first parameter from varargin, defaulting to gcf if not specified.
  2. It checks if the fig is a valid handle using ishandle. If it is not, fig is set to gcf.
  3. The function retrieves all axes objects within the specified figure using findobj with the 'Type','Axes' filter.
  4. It iterates over each axes object found and applies the specified axisparams using the axis function.

Example Usage

The function can be used in a script as follows:

close all
SGsample;   % or  SGfigure; SGplot4(SGbox)     
axisscale
axis4all('on','tight'); drawnow
axis4all(gcf, 'off'); drawnow

In this example, the function is used to apply axis settings to all subplots in the current figure, first setting them to 'on' and 'tight', and then turning them 'off'.

Algorithm explaination created using ChatGPT on 2025-08-18 23:40. (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