How do I set the current axes to a saved axes?
24 次查看(过去 30 天)
显示 更早的评论
R2017a
So I made a graph using plot(), and tinkered around with the axes until I got it looking good and saved the axes
ax = gca;
% ... tinkering ..
save('ax.mat','ax');
Now I want to graph the same thing and just set the current axes to the one I saved. I've tried using stuff like getfield and findall but I can't seem to nail down exactly what I'm looking for.
0 个评论
采纳的回答
Star Strider
2018-6-27
2 个评论
Star Strider
2018-6-27
Correct. You would have to consider the loaded .fig file as an existing figure to change the information stored in it. The problem is that the R2014b ‘Handle Graphics 2’ made this (and several other graphics manipulations) significantly more challenging. Some are straightforward, others require that you use the findobj (link) and related functions. You would need that as for example:
h = findobj(gca,'Type','line')
to find the line objects if you want to change their properties.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!