Usage of hold in and hold off in MATLAB

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.