axis4math

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.0, Creation date: 2021-02-07, Last change: 2025-08-18

sets axis for mathematical fncts instead of solid geometries or CPLs

Description


axis normal; axis tight; grid on; view(0,90); ax=axis;


See Also: , zoomVL , axisratio , axis4animation , axisscale , axis4all

Example Illustration

 missing image of axis4math

Syntax

ax=axis4math

Output Parameter

ax: axis ratio after call

Examples


meanGauss(rand(10,1))
axis4math




Copyright 2021-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, axis4math, is designed to set the axis for mathematical functions rather than solid geometries or CPLs. It is part of the SG-Library and was introduced in SolidGeometry 5.0.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the zoom factor using getfuncparams with a default value of 0.1 if not specified.
  2. Set the axis to normal and tight using axis normal and axis tight.
  3. Enable the grid with grid on.
  4. Set the view to a 2D top-down perspective using view(0,90).
  5. Get the current axis limits with ax=axis.
  6. Calculate the zoom adjustments for the x and y dimensions:
    • dx = (ax(2) - ax(1)) * zoomf: Calculate the x-axis adjustment based on the zoom factor.
    • dy = (ax(4) - ax(3)) * zoomf: Calculate the y-axis adjustment based on the zoom factor.
  7. Adjust the axis limits by adding and subtracting the calculated dx and dy values:
    • ax = ax + [-dx +dx -dy +dy]: Modify the axis limits to apply the zoom effect.
  8. Apply the new axis limits using axis(ax).

This function is useful for setting up plots for mathematical functions, ensuring that the axis is appropriately scaled and centered.

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