function RespObj = posupdate(RespObj);
%POSUPDATE  Determines new locations for response plots based on
%           the current background axes size/position.

%   Authors: Adam DiVergilio, 11-99
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.6 $  $Date: 2000/08/01 18:16:43 $

%---Get active grid of axis and selected input and output channels
[OnY,OnU,Ysel,Usel] = axisvis(RespObj);
Ny = length(OnY);
Nu = length(OnU);
if Nu<1 | Ny<1, return; end

%---Get axes info
LTIdisplayAxes = RespObj.PlotAxes;
ResizeAxes = LTIdisplayAxes(OnY,OnU);
axunits = get(ResizeAxes(:),'Units');
if ~iscell(axunits), axunits={axunits}; end

%---Resize
if all(strcmpi(axunits,'pixels'))
   %---Standard resize (pixels)
   AxesPos = axispos(Ny,Nu,RespObj.BackgroundAxes);
   set(ResizeAxes(:),{'Position'},AxesPos(:));
   %---Reposition Title/XYLabels
   labelpos(RespObj);
elseif ~isa(get(RespObj.Parent,'UserData'),'viewgui')
   %---Scaled resize (for printing)
   op = get(RespObj.Parent,'OuterPosition');
   fp = get(RespObj.Parent,'Position');
   if fp(4)>op(4) & strcmpi(get(RespObj.Handles.Title,'Units'),'points')
      %---Use scale factor when resizing prior to print
      pp = get(RespObj.Parent,'PaperPosition');
      scale = fp(4)/pp(4);
   else
      %---Don't use scale factor when returning from print
      scale = 1;
   end
   AxesPos = axispos(Ny,Nu,RespObj.BackgroundAxes,scale);
   set(ResizeAxes(:),'Units','pixels',{'Position'},AxesPos(:),{'Units'},axunits);
   %---Reposition Title/XYLabels
   labelpos(RespObj,scale);
end
