function applyNicholsPlotOpts(this,h,varargin)
%APPLYNICHOLSPLOTOPTS  set nicholsplot properties

%  Copyright 1986-2004 The MathWorks, Inc.
%  $Revision: 1.1.6.1 $   $Date: 2004/12/26 21:52:00 $

if isempty(varargin) 
    allflag = false;
else
    allflag = varargin{1};
end

h.FrequencyUnits = this.FreqUnits;
     
h.AxesGrid.XUnits = this.PhaseUnits;

if strcmp(this.PhaseWrapping,'off')
    Preferences.UnwrapPhase = 'on';
else
    Preferences.UnwrapPhase = 'off';
end

if strcmpi(this.MagLowerLimMode,'auto')
    Preferences.MinGainLimit.Enable = 'off';
else
    Preferences.MinGainLimit.Enable = 'on';
end
Preferences.MinGainLimit.MinGain = this.MagLowerLim;

Preferences.ComparePhase = struct( ...
    'Enable',this.PhaseMatching, ...
    'Freq', this.PhaseMatchingFreq, ...
    'Phase', this.PhaseMatchingValue);

h.Preferences = Preferences;

if allflag
   applyRespPlotOpts(this,h,allflag);
end