MATLABOnly used for drawingPlotThe graph output by the function does not necessarily conform to the desired format, It is often necessary to process the number, range, and interval of the subject.
Although it is not difficult to operate, it is often used and easy to forget. So here we will describe it:
X = (1:50 );
Y = sin (X );
Plot (X, Y, '-R *');
Xlabel ('x name'); % x axis name
Ylabel ('y name ');
Legend ('xxx'); % line comment. If there are multiple lines: Legend ('xxx', 'xxx2 ', 'xxx3 ')
Xlim ([2, 46]); % only sets the drawing range of the X axis
Set (GCA, 'xtick', []) % change the X axis coordinate interval to 2
% Above, we can control the X axis very well. The Y axis is similar.
Axis ([,]) % axis ([xmin, xmax, ymin, Ymax]). You can use this statement to control the upper limit and lower limit of X and Y axes, however, the interval must be changed using the set above.