x = linspace(-2, 2, 100);
y = x .^ 3;
scatter(x, y);
x = linspace(-2, 2, 100);
y = x .^ 2;
sz = linspace(1, 100, 100);
scatter(x, y, sz);
x = 3:2:11;
y=[4,5,9,6,4];
plot(x, y);
x = 3:2:11;
y=[4,5,9,6,4;5,8,2,4,3];
plot(x, y);
x = 3:2:11;
y=[4,5,9,6,4];
bar(x, y);
x=3:5;
y=[4,5,9,6,4;5,7,9,8,7;1,3,5,9,7];
bar(x,y);
只需要把bar换成bar3即可。
x=3:5;
y=[4,5,9,6,4;5,7,9,8,7;1,3,5,9,7];
bar3(x,y);
y=[4,5,9,6,4;5,7,9,8,7;1,3,5,9,7];
bar(y,'stacked');
只需要把bar改成barh即可:
y=[4,5,9,6,4;5,7,9,8,7;1,3,5,9,7];
barh(y);
clc;clear;
x =linspace(0,2*pi,60);
y = sin(x);
stem(x,y);
clc;clear;
x =linspace(0,2*pi,60);
y1 = sin(x);
y2 = cos(x);
stem(x,y1);
hold on
stem(x,y2);
y=[4,5,9,6,4];
pie(y);
把pie该为pie3即可
y=[4,5,9,6,4];
pie3(y);
X=[2,2,1,5,2];
explode = [0 1 0 0 0];
pie(X,explode);
x=3:8;
y=[45,6,8;7,4,7;6,25,4;7,5,8;9,9,4;2,6,8];
area(x,y);
在另一篇博客上有详解,如下:
Matalb画雷达图(四行代码)
分别控制左右坐标就可以了,不要太简单。而且可以很多种图形任意搭配。
x= 1:3;
y= [9.0725,9.075,9.5175];
w= [229,230,207];
yyaxis left%控制左纵轴
bar(x,y);
yyaxis right%控制右纵轴
plot(x,w);
本来想画罗盘图的,但是比较丑,估计用不上,目前就写这么多吧,还有哪些好图,评论留言告诉博主呀,以后会不断的更新,尽量总结出所有的图。