y=randn(1,10000);
subplot(2,1,1);
hist(y,10);
title('bins=10');
subplot(2,1,2);
hist(y,50);
title('bins=50');
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/120c0aad097261d801a4b841e4bccf9d.png)
x=[1 2 5 7 8];
y=[x;1:5];
subplot(1,2,1);
bar(y);
title('stacked');
subplot(1,2,2);
barh(y);
title('Horizontal');
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a026b6853c5ef7b77e5e9a231f30f8a2.png)
a=[10 5 20 30];
subplot(1,3,1);pie(a)
subplot(1,3,2);pie(a,[0 0 0 1]);%[0 0 0 0]对4个数字占比是否分开1表示分开
subplot(1,3,3);pie3(a,[0 0 0 1]);
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/93a258554a484bc66cd19de06438505b.png)
G=[46 38 29 24 13];
S=[29 27 17 26 8];
B=[29 23 19 32 7];
h=bar(1:5,[G' S' B']);
title('medle count ');
ylabel('Number of medals');
xlabel('Country');
legend('Gold','Silver','Bronze');
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/720433a93debf379965df843dc4910c6.png)