Nt=1;
Nr=2;
x=-5:1:0;
y=1:-0.2:0;
figure(1)
semilogy(x,y,'-bx')%x轴为线性刻度,y轴为对数刻度
legend('for example');%图例标签
xlabel('x');
ylabel('y');
grid on;%画图的时候添加网格线
hold on;
figure(2)
plot(x,y,'-rs')%x轴和y轴均为线性刻度(Linear scale)
hold on;%!!!!!
plot(x,2*y,'-bs')%x轴和y轴均为线性刻度(Linear scale)
legend('for example','for example first');
xlabel('x');
ylabel('y');
grid on;%画图的时候添加网格线
hold on;
figure(3)
loglog(x,y,'-g+')%x轴和y轴均为对数刻度(Logarithmic scale)
legend('for example');
xlabel('x');
ylabel('y');
grid on;
hold on;
filename = sprintf('Nt%dNr%d',Nt,Nr);
saveas(gcf,filename,'jpg');%保存当前窗口的图像
saveas(1,[filename,'a'],'jpg');%保存Figure 1窗口的图像
saveas(2,[filename,'b'],'jpg'); %保存Figure 2窗口的图像
saveas(3,[filename,'c'],'jpg'); %保存Figure 3窗口的图像
MATLAB平台学习(6)画图处理
于 2022-04-20 21:22:16 首次发布