LabKit MATLAB Workbench

reference

FrameworkApp SDK API

labkit.app.plot.showMessage

Show a centered empty-state message in an axes.

Syntax

hText = labkit.app.plot.showMessage(ax, message) hText = labkit.app.plot.showMessage(ax, message, Name=Value)

Inputs

ax
Valid scalar MATLAB axes or uiaxes handle.
message
User-visible text scalar displayed at the axes center.

Name-Value Arguments

Title
Axes title text. Default: "".
Color
MATLAB color value for the message text. Default: [0.30 0.30 0.30].

Outputs

hText
MATLAB text object containing the message.

Description

message clears the axes, resets it to linear unit limits [0 1], removes ticks, and draws non-pickable text. Use it for an empty preview, loading prompt, or unavailable result. Because it performs a complete clear, it is not an overlay operation and does not preserve the previous zoom.

Errors

labkit:app:plot:InvalidAxes
ax is not a valid scalar axes handle. labkit:app:plot:InvalidOptions or labkit:app:plot:InvalidOption - Name-value arguments are malformed or unsupported. Invalid MATLAB text or color values propagate their originating graphics error.

Example

fig = figure("Visible", "off");
cleanup = onCleanup(@() close(fig));
ax = axes(fig);
h = labkit.app.plot.showMessage(ax, "No data", "Title", "Preview");
assert(string(h.String) == "No data")

Source

This page is generated from the MATLAB help text in +labkit/+app/+plot/showMessage.m.