Usage of hold in and hold off in MATLAB
Holding on is the current axis and the graph is persisted without being refreshed, ready to accept the drawing after
Hold off causes the current axis and graphics not to have the properties to be refreshed
Hold on and hold off, is relative use
The former means that you draw a picture in the axis (coordinate system) of the current graph, and then draw another picture, the original diagram is still there, and the new diagram coexist, all can see
The latter expresses, you draw a picture in the axis (coordinate system) of the current graph, at this time, the state is hold off, then draw another picture, the original figure is not visible, on the axis is a new diagram, the original image was replaced
>> t= (0:PI/100:PI) ';
Y1=sin (t) *[1,-1];
Y2=sin (t). *sin (9*t);
t3=pi* (0:9)/9;
Y3=sin (T3). *sin (9*T3);
Plot (T,y1, ' r: ', T,y2, '-bo ')
On
Plot (T3,y3, ' s ', ' markersize ', ten, ' Markeredgecolor ', [0,1,0], ' markerfacecolor ', [1,0.8,0])
Axis ([0,pi,-1,1])
Hold off
Graphics
>> t= (0:PI/100:PI) ';
Y1=sin (t) *[1,-1];
Y2=sin (t). *sin (9*t);
t3=pi* (0:9)/9;
Y3=sin (T3). *sin (9*T3);
Plot (T,y1, ' r: ', T,y2, '-bo ')
Plot (T3,y3, ' s ', ' markersize ', ten, ' Markeredgecolor ', [0,1,0], ' markerfacecolor ', [1,0.8,0])
Axis ([0,pi,-1,1])
Hold off
Remove hold-on graphics to show only the last data
Usage of hold in and hold off in MATLAB