在我的程序中,我想要得到三个图,
plot(CumulativeReward)
title('Cumulative Reward, gamma=1');
xlabel('episode number');
ylabel('CumulativeReward')
plot(Pathlength)
title('pathlength as a function of episode number');
xlabel('episode number');
ylabel('pathlength')
x = -pi:.1:pi;
y = sin(x);
plot(x,y)
但是所有三个图都在一个框架中,我如何将每个图放在不同的框架框中?
最佳答案
在调用plot
之前调用figure
。这将打开一个新的图形窗口。
为了更容易区分窗口,可以设置它们的标题,例如
figure('name','Cumulative Reward')
如果你想要并排绘图,你可以使用subplot
,即
subplot(1,3,1)
%# your first plot here
subplot(1,3,2)
%# your second plot here
subplot(1,3,3)
#% your third plot here
关于matlab - 如何在matlab中绘制不同帧的图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12177272/