From: Maxx Chatsko on 21 Jul 2010 09:38 Hello all, I have a gui that creates several plots in different windows. Obviously, the program will create the plot in the current figure. This is problematic if the user re-selects the main control figure right before the program creates the plot because it will appear in the background of the main control figure, not in the intended new figure (which is empty). I tried using set(gcf,'myfigure') and other commands...what command would I write before plot() to set the figure? Thanks Maxx
From: Maxx Chatsko on 21 Jul 2010 09:50 I meant that I used figure() not set(), but I can't get the handle of the figure to put in the command figure()...any idears?
From: us on 21 Jul 2010 09:53 "Maxx Chatsko" <chatskom(a)chemimage.com> wrote in message <i26t7s$ikf$1(a)fred.mathworks.com>... > Hello all, > I have a gui that creates several plots in different windows. Obviously, the program will create the plot in the current figure. This is problematic if the user re-selects the main control figure right before the program creates the plot because it will appear in the background of the main control figure, not in the intended new figure (which is empty). I tried using set(gcf,'myfigure') and other commands...what command would I write before plot() to set the figure? > Thanks > Maxx one of the solutions fh(1)=figure('name','fig1'); plot(1:10); fh(2)=figure('name','fig2'); disp('press any key to cont...'); pause; figure(fh(1)); us
From: Yuri Geshelin on 21 Jul 2010 09:59 "Maxx Chatsko" <chatskom(a)chemimage.com> wrote in message <i26t7s$ikf$1(a)fred.mathworks.com>... > Hello all, > I have a gui that creates several plots in different windows. Obviously, the program will create the plot in the current figure. This is problematic if the user re-selects the main control figure right before the program creates the plot because it will appear in the background of the main control figure, not in the intended new figure (which is empty). I tried using set(gcf,'myfigure') and other commands...what command would I write before plot() to set the figure? > Thanks > Maxx figure(N), where N is the handle to the desired figure. If that figure exists, it will become current. Otherwise, it will be created. Yuri
From: Walter Roberson on 21 Jul 2010 12:35 Maxx Chatsko wrote: > I have a gui that creates several plots in different windows. > Obviously, the program will create the plot in the current figure. This > is problematic if the user re-selects the main control figure right > before the program creates the plot because it will appear in the > background of the main control figure, not in the intended new figure > (which is empty). I tried using set(gcf,'myfigure') and other > commands...what command would I write before plot() to set the figure? Don't do it that way. Instead, use explicit specification of the figure number or axes or uipanel (or as appropriate) for every graphics operation. The more common graphics operation often allow the parent to be specified as the first parameter; the great majority of the other graphic operations allow the parent to be specified by giving a 'Parent' property in the calling list. f = figure(123); ax = axes('Parent', f); plot(ax, rand(3,5)); line([0 0], [1 1], 'Parent', ax);
|
Pages: 1 Prev: reading GRIB data in matlab 7.4 version Next: periodicity and classes |