This should be mainly a
documentation item. But, I thought it would
be useful for anyone with an interest to comment on the
1. Current documentation says that hold all unconditionally
the current plot so that new commands add to the current
suggests that hold all is different from hold on.
'hold all' is different from 'hold on', however Matlab is changing their behavior. 'hold all' is now deprecated and is equivalent to 'hold on'.
On the dev branch there are plans to follow suit and deprecate 'hold
all' and add the axes graphic properties 'colororderindex' and
2. However, this is not true for subplots in
both Octave and Matlab.
plot(0:1) %% line color blue
hold on %% without this, previous data erased in both
Matlab and Octave.
plot(0:1) %% line color red for Matlab, blue for Octave
an additional hold on/all is needed after each subplot() call.
previous data in the subplot is cleared
'hold on' applies to an axes
object. For a figure with just one axes this is equivalent to the entire plot. But when using subplot() there are
multiple axes on a figure and you have to choose which ones you
want 'hold' to apply to. That
could be clarified in the documentation.
So, for Matlab compatibility the hold behavior should be left
as is, but
It would probably be appropriate to improve Matlab
implementing the color change for subsequent data plots with
If people think that this lack of Matlab compatibility is
important, a bug
report should be filled.
In any case, the Manual should be changed to reflect the
current behavior unless
anyone thinks that the behavior should be changed. It would
seem more natural
to make hold on/all do an unconditional hold for plots or
subplots (i.e. it "holds"
the figure). But, this would mean a significant
incompatibility with respect to Matlab.