MATLAB绘制直方图和阶梯形图
程序员文章站
2024-03-12 15:46:38
...
function shili18
h0=figure('toolbar','none',...
'position',[200 150 450 250],...
'name','实例18');
subplot(2,2,1)
x=-3:0.2:3;
y=exp(-x.*x);
bar(x,y)
title('2-D Bar Chart')
subplot(2,2,2)
x=-3:0.2:3;
y=exp(-x.*x);
bar3(x,y,'r')
title('3-D Bar Chart')
subplot(2,2,3)
x=-3:0.2:3;
y=exp(-x.*x);
stairs(x,y)
title('Stair Chart')
subplot(2,2,4)
x=-3:0.2:3;
y=exp(-x.*x);
barh(x,y)
title('Horizontal Bar Chart')
对bar函数不了解点击此链接:
https://zhidao.baidu.com/question/647137000753281205.html