This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Interactively Explore Plotted Data

You can interactively explore and edit plotted data to improve the visual display of the data or reveal additional information about the data. The interactions available depend on the contents of the axes, but typically include zooming, panning, rotating, data tips, data brushing, and restoring the original view.

Some types of interactions are enabled by default, while other types of interactions are only available through the axes toolbar. The toolbar appears at the top-right corner of the axes when you hover over it.

Note

In R2018a and previous releases, the interaction options appear in the figure toolbar instead of the axes toolbar. Also, in previous releases, none of the interactions are enabled by default.

Zoom, Pan, and Rotate Data

Zooming, panning, and rotating the axes let you explore different views of your data. By default, you can use the scroll-wheel to zoom in and out of the view of the axes. Also, you can click and drag the axes to pan the axes (2-D view) or rotate the axes (3-D view).

You can enable more interactions by clicking the zoom in , zoom out , pan , and rotate icons in the axes toolbar. For example, click the zoom-in icon if you want to drag a rectangle to zoom into a region of interest.

Display Data Values Using Data Tips

To help identify the x, y, and z values of a data point, use data tips. Data tips appear when you hover over a data point. If you want the data tip to persist, select the data tips icon in the axes toolbar. To create more than one data tip, use the Shift key.

Select and Modify Data Values Using Data Brushing

You can data brushing to select, remove, or replace individual data values. To brush data, select the data brushing icon from the axes toolbar. Click a data point to highlight it or drag a rectangle to highlight all the data points within the rectangle. Use the Shift key to highlight additional data points.

After you highlight the desired data points, you can use the options in the right-click context menu to remove, replace, or copy the values. The displayed plot shows your changes. Also, you see the updates to the data properties of the plotted object update (such as XData). However, the original workspace variables are not updated. Then, if you want to update the workspace variables as well, you can use the Link option on the figure Tools menu to link the variables to the plot.

Remove Outliers from Plotted Data

This example shows how to use data brushing to delete an outlier from a plot of 100 data points.

First, plot the data containing a single outlier. Then, select the data brushing icon from the axes toolbar and drag a rectangle around the outlier.

x = linspace(0,10);
y = exp(.1*x).*sin(3*x);
y(60) = 2.7;
plot(x,y)

Right-click the brushed data point and select Remove from the context menu. Notice that the plot updates. However, the workspace variable does not change.

If you want to remove the point from the workspace variable, then select the Link option from the figure Tools menu before brushing the data.

Customize Plots Using Property Inspector

You can modify plots interactively by using the Property Inspector. When you open the Property Inspector and select a plot, the inspector displays a list of properties that you can edit. To open the inspector, use the inspect function or click the Property Inspector icon on the figure toolbar.

See Also

| | | | | |

Related Topics