MATLAB常用绘图命令
发布时间:2022-11-22 00:39:03 341 相关标签:
创建新的绘图窗口:
figure 2;
plot(...);
figure 3;
plot(...);
在同一窗口中绘制多幅图:
subplot(2,2,1);
plot(...);
subplot(2,2,2);
plot(...);
subplot(2,2,3);
plot(...);
subplot(2,2,4);
plot(...);
同一坐标内绘制多条曲线并标注:
hold on;
plot(...);
plot(...);
plot(...);
hold off;
legend('aaa', 'bbb', 'ccc');
改变坐标轴间隔:
set(gca,'XTick',0:20:100);
set(gca,'YTick',0:200:1000);
标注坐标轴和标题:
xlabel 'xxx';
ylabel 'yyy';
title 'ttt';
显示曲线的部分并可移动:
% 假设曲线的 x 坐标范围 0~100
axis([0,10]); % 仅显示 0~10的部分
pan xon;% 可以左右移动曲线
显示网格:
文章来源: https://blog.51cto.com/u_15881688/5860593
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报