brush
Interactively mark data values in a chart
Description
Data brushing allows you to mark data values in a chart using a color of your choice. You can mark individual data values, or select many values to mark using a selection rectangle. Once you have values marked, you can delete them or save them to a variable in the workspace. Brush marks will persist until you remove them, even if you pan, zoom, add data tips, or edit the plot.
Most charts support data brushing, including line, bar, area, histogram, and surface charts. Charts that support brushing typically display the Brush data button in the axes toolbar.
Creation
Description
brush on turns on brushing in the current figure. With brushing
on, mark a single data value by clicking on it. Mark multiple data values by dragging a
selection rectangle around them. To add additional marks or remove unwanted marks, hold
the Shift key while brushing the values.
brush off turns off brushing. If there are existing brush marks
on the chart, this command will not remove them.
brush toggles the brush mode. For example, if brush mode is
disabled, then calling brush enables brush mode.
brush( sets the color for subsequent
brush marks. Setting the brush color does not affect current marks unless you brush
data, change the brush color, and then add or remove marks using the
Shift key. In this case, all marks update to the new color.color)
brush( sets the brush
mode for all axes in the specified figure for any of the previous syntaxes. For example,
to enable brush mode for all axes in the figure fig,___)fig, use
brush(fig,"on").
brush( sets the brush mode
for the specified axes. For example, to enable brush mode for the axes
ax,___)ax, use brush(ax,"on"). (since R2023a)
Before R2025a: Use this syntax with apps created in App
Designer or using the uifigure function.
Input Arguments
Properties
Examples
More About
Tips
To brush a histogram chart, you must first turn on data linking.
Alternative Functionality
Axes Toolbar
For some charts, enable brush mode by clicking the Brush data button in the axes toolbar.







