Simulink.sdi.getTickLabelsDisplay

Get tick mark label setting for time plots

Description

example

tickLabels = Simulink.sdi.getTickLabelsDisplay returns the current setting for displayed tick mark labels on time plots in the Simulation Data Inspector. The return value corresponds to the setting for Tick labels in the Simulation Data Inspector Time Plot Settings. The setting applies to all time plots in the layout. By default, the Simulation Data Inspector displays tick mark labels for both axes on time plots.

Examples

collapse all

You can use the Simulink.sdi.setTickLabelsDisplay function to configure the visibility of tick mark labels for the t- and y-axes on time plots in the Simulation Data Inspector. By default, the Simulation Data Inspector displays tick marks for both axes.

This example starts by showing how to use the Simulink.sdi.getTickLabelsDisplay function to access the current tick mark label visibility. Subsequent sections show the code to specify each available option for tick mark label visibility on time plots in the Simulation Data Inspector. To see the result of each configuration, the example generates an image useing the Simulink.sdi.snapshot function with settings specified by a Simulink.sdi.CustomSnapshot object.

snapSettings = Simulink.sdi.CustomSnapshot;
snapSettings.Width = 300;
snapSettings.Height = 300;

Get Current Tick Mark Label Visibility

Before modifying the visibility of the tick mark labels on time plots, you can save the current configuration to a variable in the workspace in case you want to restore the preference later.

initTickLabels = Simulink.sdi.getTickLabelsDisplay;

Show Only t-Axis Tick Mark Labels

Show the tick mark labels for the t-Axis.

Simulink.sdi.setTickLabelsDisplay('t-axis')
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Show Only y-Axis Tick Mark Labels

Show the tick mark labels for the y-axis.

Simulink.sdi.setTickLabelsDisplay('y-axis')
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Hide Tick Mark Labels

You can hide the tick mark labels for both axes.

Simulink.sdi.setTickLabelsDisplay('none')
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Show All Tick Mark Labels

By default, the Simulation Data Inspector shows tick mark labels for both axes on time plots.

Simulink.sdi.setTickLabelsDisplay('all')
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Output Arguments

collapse all

Current setting for tick mark labels displayed on time plots in the Simulation Data Inspector.

  • 'all' — Tick mark labels displayed for both time plot axes.

  • 't-axis' — Tick mark labels displayed only on the t-axis for time plots.

  • 'y-axis' — Tick mark labels displayed only on the y-axis for time plots.

  • 'none' — No tick mark labels displayed on time plots.

Introduced in R2019b