clim — Query or set colormap limits.
clim queries or configures the color limits used to map scaled chart data through the active colormap. caxis is its legacy alias.
Syntax
limits = clim()
limits = clim([cmin cmax])
limits = clim(mode)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
limits | NumericArray | Yes | — | Two-element numeric vector [cmin cmax]. |
mode | StringScalar | Yes | — | Limit mode string ('auto', 'tight', or 'manual'). |
Returns
| Name | Type | Description |
|---|---|---|
limits | NumericArray | Two-element color limit vector [cmin cmax] or [NaN NaN] when auto. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:clim:InvalidArgument | Argument count, mode, or limit vector is invalid. | clim: invalid argument |
RunMat:clim:Internal | Internal plotting state update fails. | clim: internal operation failed |
How clim works
clim()returns the current explicit color limits as a two-element double row vector.clim([cmin cmax])accepts a two-element single or double vector with finite values andcmin < cmax.- The public color-limit mode tokens are
autoandmanual;tightbelongs to axis-limit selection and is not accepted here. - All eight typed integer limit classes are a RunMat-only extension. MATLAB-compatible mode rejects them before conversion; RunMat mode validates authoritative storage before one deliberate conversion into host double graphics metadata.
caxisshares this exact integer capability and compatibility gate as an audited alias.- Resident arguments reject without provider dispatch because color limits are host graphics controls and no interactive gpuArray input is documented.
- Persistent
CLimModestate, computed automatic-limit queries, set-form output arity, and specific-target or multi-target forms remain general graphics-surface gaps.
Examples
Set and query color limits
imagesc([1 2; 3 4]);
clim([1 4]);
limits = clim();Return to automatic color limits
clim('auto');Using clim with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how clim changes the result.
Run a small clim example, explain the result, then change one input and compare the output.
Related Plotting functions
2D Charts
area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem
Other
addpoints · ancestor · animatedline · axes · barh · caxis · cla · clf · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how clim is executed, line by line, in Rust.
- View the source for clim in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.