Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Zoom / Camera Control in subplot
Date: Wed, 19 Sep 2007 19:39:24 +0000 (UTC)
Organization: Atlantic Inertial Systems
Lines: 70
Message-ID: <fcrttc$gtt$1@fred.mathworks.com>
References: <fcmth5$sis$1@fred.mathworks.com> <fcoolp$llv$1@fred.mathworks.com> <fcr39g$5fo$1@fred.mathworks.com> <fcrscc$jtr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190230764 17341 172.30.248.37 (19 Sep 2007 19:39:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 19 Sep 2007 19:39:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1091020
Xref: news.mathworks.com comp.soft-sys.matlab:429336



"Ben " <basburywvu.nospam@hotmial.com> wrote in message
<fcrscc$jtr$1@fred.mathworks.com>...
> "Adam " <not.my.email@mathworks.com> wrote in message > 
> > Interesting.  If your data is of the form z = f(x, y) you
> > may have to manually clip your data.
> > 
> > Two dockable figures may be sufficient?
> > 
> > hfig = figure('WindowStyle', 'docked');
> > plot([0:.1:10],sin([0:.1:10]));
> > 
> > hfig2 = figure('WindowStyle', 'docked')
> > hax2 = axes;
> > [x,y,z] = sphere(24);
> > axes(hax2);surf(x,y,z,'FaceColor',[0 0.2 0.8])
> > axis vis3d
> > 
> > Clicking "Top/Bottom Tile" in the top right gives a similar
> > layout.
> > 
> > ~Adam
> 
> Thanks for the response.  However, I don't know how to
> implement something like that in my case.  The above was
> just an example of what happens when zooming
> I am actually doing something similar with the plots but in
> a GUI created in GUIDE.  And I don't think you can really
> dock a figure into a window in a GUI.  It would be nice
> though to restrict the viewable area of the axis to a
> specific location.  Sort of like put the plot axes in a
> frame so it could not move or spill over covering out
> uicontrols.
> The only thing I can think off is to build the GUI using
> multiple figs(which I don't really want to do).
> I have also attempted to restrict the data created (like you
> mentioned) but still can't quite get the view I want without
> using either zoom or camera commands which change the size
> of the plot axis displayed on the fig.
> 
> Thanks for the input.

yeah, weird situation.  What I would do, make a new figure
window for the 3d graph.  You can add this to the opening
function

    hFig = figure;
    set(hFig, 'MenuBar', 'none', 'Toolbar', 'figure')

 % create callback to prevent figure from being 
 % explicitly closed
    set(hFig, 'CloseRequestFcn', ...
   'guiServoLoop(''fig_CloseFcn'',gcbo,[],guidata(gcbo))');

    handles.figGraph = hFig;   % add figure to handle list
    guidata(hObject, handles)  % saves update to handles

then add the function

% --- Executes upon close request to graph window
function fig_CloseFcn(hObject, eventdata, handles)
    %do nothing

and add to your main figure's deletefcn or closerequestfcn
(not sure if it matters, I'm using the deleteFcn) the
following line
    delete(handles.figGraph)

otherwise I have no idea, gl.

~Adam