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()
clim([cmin cmax])
clim('auto'|'manual')
limits = clim(axes)
clim(axes,[cmin cmax])
clim(axes,'auto'|'manual')Inputs
limits- Type
NumericArray- Required
- Yes
- Description
- Two-element numeric vector [cmin cmax].
mode- Type
StringScalar- Required
- Yes
- Description
- Color-limit mode string ('auto' or 'manual').
axes- Type
AxesHandle- Required
- Yes
- Description
- Existing axes handle; does not change the current axes.
mode- Type
StringScalar- Required
- Yes
- Description
- Automatic or manual limit mode token.
Returns
limits- Type
NumericArray- Description
- Displayed two-element color limit vector [cmin cmax], including automatically selected bounds.
Errors
RunMat:clim:InvalidArgument- When
- Argument count, mode, or limit vector is invalid.
- Message
clim: invalid argument
RunMat:clim:Internal- When
- Internal plotting state update fails.
- Message
clim: internal operation failed
RunMat:clim:TooManyOutputs- When
- More than one output is requested.
- Message
clim: at most one output is supported
Assigned setter outputs
The MATLAB-compatible setter form has no assigned output. RunMat mode preserves the existing one-output setter result as a gated extension; strict compatibility rejects that request before changing graphics state.
Behavior and compatibility
clim() returns the displayed color limits as a two-element double row vector, including automatic scalar-color bounds when available.
clim([cmin cmax]) accepts a two-element single or double vector with finite values and cmin < cmax.
The auto token restores automatic color scaling; manual freezes the currently available scalar color extent. Empty or non-mapped scalar plots use the renderer's default range; an unavailable scalar extent cannot be frozen. tight is not a color-limit mode.
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.
caxis shares 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.
An existing axes handle can be supplied first for query or setter forms without selecting it as the current axes. Axes-handle arrays and color contributors outside the shared scalar-color range owner remain unsupported.
Placement
The control updates host graphics state. Resident control operands reject before provider access; existing resident plot data retains its rendering owner.
The whole-call allocation, graphics presentation, and callback execution routes still require integrated qualification.
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 · autumn · axes · barh · bone · caxis · cla · clf · colorcube · colororder · cool · copper · copyobj · cylinder · daspect · datacursormode · dataTipTextRow · drawnow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · gray · groot · hgload · hgsave · hidden · histogram2 · hold · hot · inferno · isgraphics · ishandle · jet · line · lines · linkaxes · magma · openfig · opengl · pan · parula · patch · pink · plasma · plotmatrix · plotyy · polarhistogram · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · spring · stackedplot · subtitle · summer · suptitle · text · textscatter · textscatter3 · triplot · turbo · viridis · waitbar · winter · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom
Source you can read
Every RunMat function's source is public. 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 a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/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.