LoginSignup
1
0

More than 5 years have passed since last update.

Matlabで別のFigureファイルを操作する

Last updated at Posted at 2018-02-25

メインのfigureとサブのfigureをGUIDEなどで作成して、
メインのfigureからサブのfigureを操作したいときのやり方。

サブのfigureには、1つのaxisしか存在しない場合を想定。

% サブのfigureを非表示でオープン
fig = openfig('subfigure.fig','invisible')

% サブのfigureのaxisのハンドルを取得
subAxis = findobj(fig.Children, 'Tag', 'axes1');

% サブのfigureに散布図を表示
scatter(subAxis, x, y, 50, 'red', 'filled');

% サブのfigureをpngとして保存
print(fig, '-dpng', 'subfigure.png');

% サブのfigureを表示
fig.Visible = 'on'
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0