Http://wenku.baidu.com/link?url= Svvmvh8qldiu2hvkdtobys6l0cnqvfnfhjj9yexmyvkqqhz47qir7ak7lof8nn0qndy8o1calxqfub5dwr5avdqtlujyp6zi9tdhjws7_27
Y Yellow · Point line
M Pink 0 Circle Line
C Bright Blue XX line
R Red + + Word line
G Green-Solid line
b Blue * Star-shaped line
W White: Dashed
K Black-.
--Dot Dash
matlab6.1 linear:
[+ | o | * |. | x | square | diamond | v | ^ | > | < | pentagram |hexagram]
Square Squares
Diamond Diamond
Pentagram Pentagram
Hexagram Six-point star
Usage
Grid open gridlines-Dashed line
The hold command is used to add new graphics to a drawn graphic
1 x=0:0.001:10; % 0 to 10 of 1000 points (every 0.001 draws a point) x-coordinates
Y=sin (x); % corresponding y-coordinates
Plot (x, y); % drawing
Note: Matlab drawing is actually a stroke line, so if the point obtained is not dense, the drawing is a linear chart, please test
2 Y=sin (10*x);
Plot (x, Y, ' r: ', X, y, ' B ')% draw two functions at a time
3 To change the color, add the relevant string to the following tag pairs:
X=0:0.01:10;
Plot (X,sin (x), ' R ')
4 to change the color and the Linetype state (line style) at the same time, you can also add related strings to the coordinate pairs:
Plot (X,sin (x), ' r* ')
5 Using the axis ([Xmin,xmax,ymin,ymax]) function to adjust the extent of the graph axis
Axis ([0,6,-1.5,1])
6 Matlab can also add various annotations and processing of graphics: (see table above)
Xlabel (' x-axis '); % x Axis annotations
Ylabel (' Y axis '); % y-axis annotations
Title (' cosine function '); % Graphics title
Legend (' y = cos (x) '); % Graphics annotations
Gtext (' y = cos (x) '); % graphical annotations, positioning the annotation position with the mouse
Grid on; % Display Gridlines
7 Draw Ellipse
A = [0:pi/50:2*pi] '; % angle
X = cos (a); % parametric equation
Y = sin (a) * *;
Plot (x, y);
Xlabel (' x '), Ylabel (' Y ');
Title (' Ellipse ')
8 Draw the curve of the function at 0≤x≤1.
X=0:0.1:1
Y=x.*exp (-X)% Why use point arithmetic? What if it doesn't?
Plot (x, y), Xlabel (' x '), Ylabel (' y '), title (' Y=x*exp (x) ')
9 Draw the attenuation oscillation curve with its envelope line and. The range of values for T is [0, 4π].
T=0:pi/50:4*pi;
Y0=exp (-T/3);
Y=exp (-T/3). *sin (3*t);
Plot (T,y, '-R ', T,y0, ': B ', T,-y0, ': B ')%-R denotes a solid red line,: B denotes a blue dot line, looks at the table
Grid
10 set up several coordinate systems on the same screen, with subplot (m,n,p) command; Divide a picture into MXN graphics area, p represents the current region number, and draws a diagram in each region, as
X=linspace (0,2*pi,30); Y=sin (x); Z=cos (x);
U=2*sin (x). *cos (x); V=sin (x)./cos (x);
Subplot (2,2,1), plot (x, y), Axis ([0 2*pi-1 1]), title (' Sin (x) ')
Subplot (2,2,2), Plot (x,z), axis ([0 2*pi-1 1]), title (' cos (x) ')
Subplot (2,2,3), Plot (x,u), axis ([0 2*pi-1 1]), title (' 2sin (x) cos (x) ')
Subplot (2,2,4), Plot (x,v), axis ([0 2*pi-20]), title (' Sin (x)/cos (x) ')
(matlab) plot paint Color Line (GO)