Modify Figures in Live Scripts
You can modify figures interactively in the Live Editor. Use the provided tools to explore data and add
formatting, annotations, or additional axes to your figures. Then, update your code to reflect changes
using the generated code.
Explore Data
You can pan, zoom, and rotate a figure in your script using the tools that appear in the upper-right
corner of the figure axes when you hover over the figure.
•
— Add data tips to display data values.
•
— Rotate the plot (3-D plots only).
•
— Pan the plot.
•
, — Zoom in and out of the plot.
•
— Undo all pan, zoom, and rotate actions and restore the original view of the plot.
To undo or redo an action, click
or
at the upper right corner of the toolstrip.
Note When you open a saved live script,
appears next to each output figure, indicating that the
interactive tools are not available yet. To make these tools available, run the live script.
Suppose that you want to explore the health information for 100 different patients. Create a live
script called patients.mlx and add code that loads the data and adds a scatter plot that shows the
height versus weight of two groups of patients, female and male. Run the code by going to the Live
Editor tab and clicking
Run.
load patients
figure
Gender = categorical(Gender);
scatter(Height(Gender=='Female'),Weight(Gender=='Female'));
hold on
scatter(Height(Gender=='Male'),Weight(Gender=='Male'));
hold off
19 Live Scripts and Functions
19-12
Précédent

- 630/1450

Suivant