Home Insert figure into uipanel in Matlab
Reply: 1

Insert figure into uipanel in Matlab

Benjamin Levy
Benjamin Levy Published in 2018-01-11 12:43:04Z

I have a parent figure on which I placed tabs with uitabgroup. Each tab contains two panels. Each panel has an axes handle. I want to be able to print plotted results from either panel on any tab. Is it possible to insert a figure object into the panel with something like:

hTabGroup               = uitabgroup('Parent', parent); 
% parent here is the main GUI figure as gcf passed in
set( hTabGroup, 'position', [ 0.35, 0.005, 0.6, 0.234] );
hTabs(1)                = uitab('Parent', hTabGroup, 'Title', 'A');
hTabs(2)                = uitab('Parent', hTabGroup, 'Title', 'B');
hTabs(3)                = uitab('Parent', hTabGroup, 'Title', 'C');

panelA              = uipanel('Parent',hTabs(1),...
    'Position',[0.00    0.0050    0.500    0.9750], ...
    'Title', 'fuel burn vs. distance' );

panelB                 = uipanel('Parent',hTabs(1),...
    'Position',[0.50    0.0050    0.500    0.9750] );

panelAxesA                = axes( 'Parent', panelA );
set( panelAxesA, 'position', [0.100    0.25    0.85    0.7 ] );

hFig = figure('Menubar', 'none');

Can I make hFig a 'child' of panelA?

gnovice Reply to 2018-01-11 15:29:10Z

A figure object can only have a root object as its parent.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294062 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO