Skip to content

Figures in MATLAB

Hierarchy of Figure objects.

v2_gobjects_top-01

Commonly usefull plot options

Take the following example:

plot(x, y, '-', DisplayName='blabla', HandleVisibility='off')
  • DisplayName: Label for the data. Calling legend() will create thee legend using the DisplayName.
  • HandleVisibility: If off the series will not appear in the legend.

Reset color order

set(gca,'ColorOrderIndex',1)  % reset color order for plot

or

ax = gca;
ax.ColorOrderIndex = 1;  % reset color order for plot