function p = getPlotOpts(p,h)
% GETPLOTOPTS Gets plot options of @plot h and assigns them to p

%  Author(s): C. Buhr
%  Copyright 1986-2004 The MathWorks, Inc.
%  $Revision: 1.1.6.1 $ $Date: 2004/12/26 21:52:18 $

% Get Title info
TitleStyle = h.AxesGrid.TitleStyle;
p.Title = struct('String',     h.AxesGrid.Title, ...
                 'FontSize',   TitleStyle.FontSize, ...
                 'FontWeight', TitleStyle.FontWeight, ...
                 'FontAngle',  TitleStyle.FontAngle, ...
                 'Color',      TitleStyle.Color);
     
% Get Xlabel info
XLabelStyle = h.AxesGrid.XLabelStyle;
p.XLabel = struct('String',     h.AxesGrid.XLabel, ...
                  'FontSize',   XLabelStyle.FontSize, ...
                  'FontWeight', XLabelStyle.FontWeight, ...
                  'FontAngle',  XLabelStyle.FontAngle, ...
                  'Color',      XLabelStyle.Color);

% Get Ylabel info
YLabelStyle = h.AxesGrid.YLabelStyle;
p.YLabel = struct('String',     {h.AxesGrid.YLabel}, ...
                  'FontSize',   YLabelStyle.FontSize, ...
                  'FontWeight', YLabelStyle.FontWeight, ...
                  'FontAngle',  YLabelStyle.FontAngle, ...
                  'Color',      YLabelStyle.Color);

% Get Tick Label info
TickLabelStyle = h.AxesGrid.AxesStyle;
p.TickLabel = struct('FontSize',   TickLabelStyle.FontSize, ...
                     'FontWeight', TickLabelStyle.FontWeight, ...
                     'FontAngle',  TickLabelStyle.FontAngle, ...
                     'Color',     TickLabelStyle.XColor);                  

% Get Grid info
p.Grid = h.AxesGrid.Grid;

% Get Lim and Limmode info
ax = h.AxesGrid.getaxes('2d');  
p.XLim = get(ax(1,:),{'Xlim'});     
p.XLimMode = h.AxesGrid.XLimMode;

p.YLim = get(ax(:,1),{'Ylim'});
p.YLimMode = h.AxesGrid.YLimMode;