MATLAB, plot () color line drawing of the Greek alphabet and parameter settings

Reprinted from: https: //www.cnblogs.com/sddai/p/5399462.html

     yellow dotted line y ·

     m pink ○ coiling
     c Brilliant Blue Line × ×
     r + red + wordline 
     g Green - solid line
     b * astroid blue
     w white: the dashed line
     k Black -
                             - dot chain line
matlab6.1 line:
[+ | o | * |. | x | square | diamond | v | ^ |> | <| pentagram | hexagram]

    square square
    diamond diamond
    pentagram pentacle
    hexagram Star of David

usage

Open mesh grid line - dashed line
hold on command to add the new pattern has been drawn a good pattern
1 x = 0: 0.001: 10 ; 1000 points from 0 to 10% (a point every 0.001 Videos) of x coordinate
y = sin (x);% corresponding y-coordinate
plot (x, y);% plot
NOTE: matlab drawing connection points is actually described, so if the dot density is not achieved, it becomes a line graph drawn Please test of
2 SiN the Y = (10 * X);
Plot (X, Y, 'R & lt:', X, the Y, 'B')% two functions simultaneously Videos
3 to change colors, the coordinates on the back plus Related to the string:
X = 0: 0.01: 10;
Plot (X, SiN (X), 'R & lt')
. 4 and FIG to simultaneously change the color line patterns (line style), also behind the increase in coordinates Related to the string:
Plot (X, SiN (X), 'R & lt *')
. 5 with the axis ([xmin, xmax, ymin , ymax]) function to adjust the range of the diagrams
axis ([0,6, - 1.5,1])
. 6 the MATLAB may also be coupled with a variety of graphic processing annotations :( see table above)
the xlabel ( 'X-axis');% x-axis annotation
ylabel ( 'y-axis');% y-axis annotation
title ( 'cosine');% graphic title
legend ( 'y = cos (x )');% graphical notation
gtext ( 'y = cos (x )');% Graphical annotations, notes locating position with the mouse
grid on;% show gridlines
7 oval painting
a = [0: pi / 50 : 2 * pi] ';% angle
X = cos (a) * 3 ;% parametric equation
the Y = SiN (A) * 2;
Plot ( X-, the Y);
the xlabel ( 'X'), ylabel ( 'Y');
title ( 'elliptical')
8 function plotted curve of 0 ≤ x 1 ≤.
= 0 the X-: 0.1: 1
. the y-the X-* = exp (-x)% Why use operation point? What happens if no
Plot (X, Y), the xlabel ( 'X'), ylabel ( 'Y'), title ( 'X * Y = exp (the -X-)')
. 9 ringing curve drawn with its envelope and line. t is the range [0, 4π].
= 0 T: PI / 50: * PI. 4;
yO = exp (-t /. 3);
Y = exp (-t /. 3) SiN * (T *. 3);.
Plot (T, Y, '- R & lt' , t, y0, ': b ', t, -y0, ': b')% -r solid line represents red,: b represents blue dotted lines, fancy table
Grid
10 several established on the same screen coordinates based, command subplot (m, n, p) ; the screen is divided into a graphic region having m × n, P representing the current number of regions, each region in each draw a diagram, as
x = linspace (0,2 * PI, 30); SiN Y = (X); Z = COS (X);
. SiN U = 2 * (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 20]),title('sin(x)/cos(x)')

 

 

上下标: ^{任意字符} _{任意字符}
figure,title('\ite^{-t}sint'); %% \it表示斜体
figure,title('x~{\chi}_{\alpha}^{2}(3)');
Matlab中给图形添加希腊字母

\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu \nu \xi \omicron \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega
大写 小写 英文注音 国际音标注音 中文注音
1 Α α alpha a:lf 阿尔法
2 Β β beta bet 贝塔
3 Γ γ gamma ga:m 伽马
4 Δ δ delta delt 德尔塔
5 Ε ε epsilon ep`silon 伊普西龙
6 Ζ ζ zeta zat 截塔
7 Η η eta eit 艾塔
8 Θ θ theta θit 西塔
9 Ι ι iota aiot 约塔
10 Κ κ kappa kap 卡帕
11 ∧ λ lambda lambd 兰布达
12 Μ μ mu mju 缪
13 Ν ν nu nju 纽
14 Ξ ξ xi ksi 克西
15 Ο ο omicron omik`ron 奥密克戎
16 ∏ π pi pai 派
17 Ρ ρ rho rou 肉
18 ∑ σ sigma `sigma 西格马
19 Τ τ tau tau 套
20 Υ υ upsilon jup`silon 宇普西龙
21 Φ φ phi fai 佛爱
22 Χ χ chi phai 西
23 Ψ ψ psi psai 普西
24 Ω ω omega o`miga 欧米伽
matlab中使用legend的时候,不让其显示边框:
legend('boxoff')
画线多条线
line([x1;x2;...],[y1;y2;...]) %画线条
[mag,phase,w]=bode(g0,'k-.',{0.01,1000}); 得到的 mag为三维数组,可以用AA=mag(:,:,:)'求转置的方法得到其中的单列数据。
设置默认线型的粗细
set(0,'DefaultLineLineWidth',1);
% set(0,'DefaultAxesColorOrder',[0 0 0])
set(0,'DefaultAxesLineStyleOrder',('-|--|:|-.'));
set(0, 'DefaultAxesFontSize', 14);


'.' 用点号绘制各数据点 '^' 用上三角绘制各数据点
'+' 用'+'号绘制各数据点 'v' 用下三角绘制各数据点
'*' 用'*'号绘制各数据点 '>' 用右三角绘制各数据点
' .' 用'.'号绘制各数据点 '<' 用左三角绘制各数据点
's'或squar 用正方形绘制各数据点'p' 用五角星绘制各数据点
'd'或diamond用菱 形绘制各数据点 'h' 用六角星绘制各数据点
这些选项可以连在一起用,如:'-.g'表示绘制绿色的点划线,'g+'表示用绿
色的 '+'号绘制曲线.

 

发布了6 篇原创文章 · 获赞 92 · 访问量 20万+

Guess you like

Origin blog.csdn.net/zhy295006359/article/details/78736354