matlab - 如何在matlab中绘制不同帧的图

标签 matlab

在我的程序中,我想要得到三个图,

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/

相关文章:

c - 使用Mex环境时设置环境变量

Matlab - 从[MxN]矩阵元素中快速减去[1xN]数组

java - 如何正确将反向传播神经网络的权重和偏差值导出到另一种编程语言(Java)

matlab - 在 Matlab 中检查有理函数是否简化为多项式

matlab - 未找到保存图

matlab - 没有重复的行 - MATLAB

matlab - 在 Matlab 中使用 sprintf?

algorithm - MATLAB 中的可对角化矩阵

image - 在matlab中重命名图像文件名

math - matlab代码中的碱基转换错误