How can I plot a previous plot into a new figure?
2 次查看(过去 30 天)
显示 更早的评论
I have a for loop that is plotting Temperature against Fuel-Mass Percent. The temperature values are being read from text files. Each time a text file is read the previous temperature matrix is erased. I plotted the first set of Temperature values in figure 1 and the second set of Temperature values in figure 2, but now I need to plot the second set of Temperature plot with Temperature sets 3,4, and 5. How can I store the second figure and add it to my third figure which contains plots 3,4, and 5? Thank you for the help!
0 个评论
回答(1 个)
Walter Roberson
2013-11-20
Well...
figure2 = 2; %you said "figure 2" so I assume its numeric handle is 2.
figure3 = 3; %you said "figure 3" so I assume its numeric handle is 3.
ax2 = findobj(figure2, 'type', 'axes');
ax3 = findobj(figure3, 'type', 'axes');
copyobj(get(ax2, 'Children'), ax3);
But really, easier is to just keep a copy of the data and plot() it along with the other data.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!