function dummy = plotgrid(Editor,Ts)
%PLOTGRID  Plots S or Z grid on Root Locus editor.
%
%    PLOTGRID(EDITOR,Ts) plots an S or Z grid on 
%    the Root Locus editor axes.
%
%    See also SISOTOOL.

%    Authors: P. Gahinet
%    Revised: A. DiVergilio
%    Copyright 1986-2000 The MathWorks, Inc. 
%    $Revision: 1.5 $  $Date: 2000/06/14 20:21:50 $

% REVISIT
dummy = [];

% First destroy existing grid
% REVISIT: combine next two lines
HG = Editor.HG;
delete(HG.GridLines(ishandle(HG.GridLines)))

% Grid options
s.FrequencyUnits = Editor.FrequencyUnits;
s.GridLabelType = Editor.GridOptions.GridLabelType;
s.SampleTime = Ts;

% Generate and plot new grid 
if Ts==0
   chartfun = 'spchart';
else
   chartfun = 'zpchart';
end
[GridHandles,TextHandles] = feval(chartfun,HG.PlotAxes,s);

% REVISIT: combine next two lines
HG.GridLines = [GridHandles; TextHandles];
Editor.HG = HG;
