get — Get graphics object properties in MATLAB and RunMat.
get reads properties from figure, axes, legend, text, and plot-child handles. The supported fields depend on the handle family. Graphics state remains local to the current runtime.
Syntax
value = get(h)
value = get(h, property)Inputs
h- Type
Any- Required
- Yes
- Description
- A live graphics handle.
property- Type
PropertyName- Required
- Yes
- Description
- Case-insensitive property name.
Returns
value- Type
Any- Description
- A property value or the known-property struct.
Errors
RunMat:get:InvalidArgument- When
- The handle or property selector is invalid, or property validation fails.
- Message
get: invalid argument
RunMat:get:Internal- When
- Graphics state or source-data readback fails after admission.
- Message
get: internal operation failed
Behavior
get(h) returns a struct of the known properties for the selected graphics handle. get(h, 'PropertyName') returns one property value; unsupported properties raise a plotting error.
Figure, axes, text, legend, and child plot objects expose different fields. Zoom, pan, and data-cursor control objects expose controls such as Enable, but do not expose a universal Type field. Axes-local fields include limits, scale modes, legend visibility, and text metadata. The returned property payload keeps its stored class, including integer data.
Typed integer aliases for RunMat's numeric graphics handles require RunMat compatibility mode and exact representability. The documented compatibility surface is graphics objects, not arbitrary numeric arrays.
Source data and execution
Graphics properties are host state, but line, scatter, and 3-D line source coordinates can be retained in plotting-owned GPU buffers. Reading those properties may suspend for source readback; it does not run a numeric array kernel or alter the caller's buffer ownership.
A failed readback retains its typed cause. Native and browser execution use the same async runtime binding; an unknown handle or property still raises a plotting error.
Examples
Inspect a line property struct
h = plot(1:5, [1 4 2 5 3]);
props = get(h);Read an axes-local property
ax = subplot(1, 2, 2);
semilogx(logspace(0, 2, 50), logspace(0, 2, 50));
set(ax, 'FontSize', 12);
get(ax, 'FontSize')Expected output:
ans =
12Inspect a legend handle
plot(1:5, 1:5);
lg = legend('series');
get(lg, 'Orientation')Using get with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how get changes the result.
Run a small get example, explain the result, then change one input and compare the output.
FAQ
How do I see available properties?⌄
Call get(h) without a property name. The resulting struct lists the known properties for that handle type.
Can I query axes handles?⌄
Yes. Axes, legends, text objects, and plot-child handles use the same interface. For axes, get(gca,'XScale') reads the x-axis scale mode, get(gca,'View') reads the camera angle, and get(gca,'FontSize') reads the tick-label font size.
What if a property does not exist?⌄
RunMat raises a plotting error. Call get(h) to inspect the fields exposed by that handle family.
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 · clim · 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
More plotting resources
Source you can read
Every RunMat function's source is public. Read exactly how get is executed, line by line, in Rust.
- View the source for get 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.