复制图 (1) 并将副本分配给图 (2)

Duplicate figure(1) and assign the duplicate to figure(2)

我在Matlab中创建了下图(figure(1))。

我正在尝试创建一个图 (2),它将与图 (1) 完全相同 - 换句话说,复制图 (1) 和我想将其分配为图 ( 2).

原因是我希望能够按原样呈现图(1) 然后在图(2) 中我只想呈现图(1) 的一部分(例如部分x 在 0.333 和 0.666 之间)。

有什么想法吗?

您可以使用

copyobj(gcf, groot)

这将创建一个副本 (copyobj) of the current figure (gcf), including its children, as a new child of the graphics root object (groot)。