how to manipulate fig file

26 ビュー (過去 30 日間)
Igenyar
Igenyar 2023 年 9 月 6 日
コメント済み: Voss 2023 年 9 月 6 日
I want to open a fig file, and do the following manipulation.
The fig contains several plots. I want to change the range of y-axis for some of the plots (not all of them).
>> figure
>> hold on
>> fig = openfig('my_plots.fig')
list plots
select some of them
change the y-axis range
??

採用された回答

Voss
Voss 2023 年 9 月 6 日
Here's an example:
% create a figure with a couple of plots and save it to a .fig file:
f = figure();
subplot(2,1,1)
plot(1:10,1:10)
subplot(2,1,2)
plot(1:10,2:2:20)
saveas(f,'my_plots.fig')
% openfig() the .fig file and modify one of the axes YLim (note that
% ax(1) is the bottom axes and ax(2) is the top axes):
fig = openfig('my_plots.fig');
ax = findobj(fig,'Type','axes');
ax(2).YLim = ax(1).YLim;
  2 件のコメント
Igenyar
Igenyar 2023 年 9 月 6 日
@Voss, It works great, thank you for the help!
Voss
Voss 2023 年 9 月 6 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by