Main Content

Property Inspector

View and modify object properties

Description

The Property Inspector is an interactive tool for viewing and modifying the properties of objects, such as graphics objects, within the MATLAB® workspace.

Using this tool, you can:

  • View and modify properties of selected objects in a figure or app.

  • Change visual attributes of objects, such as color, font size, and line style.

  • Edit shared properties of multiple objects at once.

  • Explore the hierarchy of objects within a figure.

  • Show or hide objects within a figure.

Property Inspector

Open the Property Inspector

  • Figure: On the Format tab of the figure, in the Enable section, enable plot edit mode by clicking Select & Plot Edit. Then, in the Inspect section, click More Properties.

  • MATLAB command prompt: Enter inspect.

Examples

expand all

Use the Property Inspector to change the transparency of a surface plot and to change the font size of the axes text.

Create a surface plot and open the Property Inspector. Then, view the surface properties in the Property Inspector by clicking the surface. Use the inspect function to enable plot edit mode and open the Property Inspector.

surf(peaks(25))
inspect

A surface plot is on the left with the surface selected, and the Property Inspector is on the right and displays the names and editable values of surface properties.

Change the value of the FaceAlpha property to 0.5. The surface plot updates so that it is semitransparent.

Then, select the axes. To select the axes, you can click the axes directly in the figure or you can expand the first line labeled Figure 1 > Axes in the Property Inspector and select the axes object from the tree. Then, change the value of the FontSize property to 14 and the FontWeight property to bold.

A semitransparent surface plot with larger, bold axes text is on the left with the axes selected, and the Property Inspector is on the right and displays the names and editable values of axes properties.

Interact with a graphics object in a figure by using the graphics object hierarchy in the Property Inspector.

Create a line plot with a legend and open the Property Inspector. Then, display the graphics object hierarchy by clicking the button next to the figure name.

plot(rand(5))
legend
inspect

A figure showing a line plot with five lines and a legend is on the left, and the Property Inspector displaying the graphics object hierarchy is on the right. The hierarchy shows a figure containing a legend and an axes object, which contains five lines.

You can interact with the graphics object hierarchy in these ways to control the view of the figure:

  • To hide an object, right-click its name in the Property Inspector and select Hide. The object still exists, but it is no longer visible in the figure. To display the object again, right-click its name and select Show.

  • To remove an object from the figure, right-click its name and select Delete.

  • To select an object to edit, click its name. The figure highlights the selected object, and the Property Inspector updates to display fields where you can view and modify the properties of the object.

For example, hide all of the data series from data2 to data5. In the Property Inspector, select data2, hold Shift, and select data5. Then, right-click the selection and select Hide.

The figure shows a line plot with four lines and a legend with four hidden entries. The Property Inspector displays the updated graphics object hierarchy, showing a figure containing a legend and an axes object, which contains one visible line and four hidden lines.

Programmatic Use

inspect opens the Property Inspector for the current figure, if one exists. To view properties for a specific object in the figure, select the object.

If no figures exist, then this command opens an empty Property Inspector.

inspect(obj) displays the properties for the specified object. You can specify obj as a single object or as a vector containing multiple objects, such as [obj1 obj2]. If you specify multiple objects, then the Property Inspector displays the properties that the objects have in common.

inspect -close closes the Property Inspector.

Version History

Introduced before R2006a