Create Panel with 6 .fig Figures

31 ビュー (過去 30 日間)
Ellyn Gray
Ellyn Gray 2018 年 1 月 27 日
コメント済み: Ellyn Gray 2018 年 6 月 13 日
I'm learning how to create a panel with figures already made with matlab and saved as .fig. I would like to learn how to use the panel function, but the tutorials are designed for someone plotting the data into each subplot, whereas I would like to upload an already-generated figure from my files. It is not realistic for me to put the lengthy and time consuming code that generated each figure into the routine.
I understand how to create the parent figure itself, but don't know how to upload the .fig files into the children. I took a stab by just assigning the figures to each child, but it didn't like that. Would love some other ideas because I've been searching forever!
Error I received: "Error using panel/subsasgn (line 2585) you cannot assign to a child panel"
vis=open('visibilityCV.fig'); %opens figures
tmin=open('TMINCV.fig');
prcp=open('PRCPCV.fig');
dpd=open('dewpointDepressionCV.fig');
ws=open('windSpeedCV.fig');
slp=open('SLPCV.fig');
p=panel(); %creates parent panel
p.pack(3,2); %packs a 3x2 grid
p(1,1).select(); %selects first subplot
p(1,1)=vis;
p(1,2).select();
p(1,2)=tmin;
p(2,1).select();
p(2,1)=prcp;
p(2,2).select();
p(2,2)=dpd;
p(3,1).select();
p(3,1)=ws;
p(3,2).select();
p(3,2)=slp;
Thank you!
  4 件のコメント
Photonics1000
Photonics1000 2018 年 5 月 14 日
Did you ever get an answer, Ellyn? I'm struggling with the same problem.
Ellyn Gray
Ellyn Gray 2018 年 6 月 13 日
I honestly cheated and just used photoshop, because I was in a rush, but I will try these solutions later this month. Thank you to everyone for their feedback!

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

回答 (1 件)

Veda Upadhye
Veda Upadhye 2018 年 1 月 29 日
編集済み: Walter Roberson 2018 年 5 月 15 日
Hi Ellyn,
As Walter has pointed out, looks like you are using the File Exchange function 'panel' for your code: https://www.mathworks.com/matlabcentral/fileexchange/20003-panel
I would recommend you to take a look at the following MATLAB Answers post which makes use of MATLAB functions to create a figure with 2 existing figures. You may expand this to 6 figures.
Here you may use 'openfig' function instead of 'hgload'.
Hope this was helpful!
Thanks,
Veda
  2 件のコメント
Ellyn Gray
Ellyn Gray 2018 年 1 月 31 日
Hi Veda, thanks for your thoughts. I was hoping to learn how to use the panel function rather than subplot since it's more customizable long term. Do you think subplot is just as good? Would I be able to adopt that syntax for using panel?
Walter Roberson
Walter Roberson 2018 年 5 月 15 日
The point of #85219 is that you copyobj() content into container objects. Graphics objects can only be directly parented to axes or hggroup or hgtransform, but axes can be parented to uipanel or uitabgroup .

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

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by