Syntax
cax=VMcaxis([cax])
Input Parameter
cax : | | [cmin cmax]; default is min and max of the current! surfaces |
Output Parameter
cax : | | selected Values if called without input paramter |
Examples
VMplot(VM)
VMcaxis
Copyright 2017-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, VMcaxis
, is designed to adjust the color axis limits of a VMplot diagram. It is part of the SolidGeometry library and was introduced in version 3.8. The function can be used to set the color axis limits based on the current surfaces in the plot or based on user-specified limits.
Input Parameters
- cax: An optional input parameter, which is a two-element vector [cmin cmax]. It specifies the minimum and maximum values for the color axis. If not provided, the function calculates these values based on the current surfaces in the plot.
Output Results
- cax: The selected color axis values. If the function is called without an input parameter, it returns the calculated minimum and maximum values of the current surfaces.
Algorithm Steps
- Initialize
cax
as an empty array. If an input parameter is provided and is not empty, set cax
to this input value.
- Declare two global variables:
VMcax
and VMplothandle
.
- Activate the figure associated with
VMplothandle
.
- Initialize
cmin
to positive infinity and cmax
to negative infinity.
- Select the first subplot (2,2,1) and find all surface objects in the current figure.
- Retrieve the color data (
Cdata
) from these surface objects.
- Iterate over the color data to find the minimum and maximum values across all surfaces, updating
cmin
and cmax
accordingly.
- If
cax
is empty, set it to [cmin
cmax
].
- Apply the color limits
cax
to the subplots (2,2,1), (2,2,2), and (2,2,4) using the clim
function.
- Assign the final
cax
value to the global variable VMcax
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:48. (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