Short answer: You need to add the grid after calling sigma().
Long answer:
Assuming you're using the DynamicSystem method (toolbox \ control \ ctrlanalysis \ @DynamicSystem \ sigma.m), sigma() calls the helper function sigmaplot() which calls ltiplot() which does the plotting.
If "hold on" was not called prior to calling sigma(), the axes are cleared using cla() in ltiplot() as shown below.
if NewPlot
matlab.graphics.internal.clearNotify(ax);
if ~isempty(h)
cla(h.AxesGrid,handle(ax))
else
cla(ax,'reset')
end
If "hold on" was called prior to calling sigma(), ltiplot() changes a bunch of axes properties. Listed below are the default PlotOptions created in ltiplot() and the changes made to the axis properties.
PlotOptions =
FreqUnits: 'auto'
FreqScale: 'log'
MagUnits: 'dB'
MagScale: 'linear'
IOGrouping: 'none'
InputLabels: [1×1 struct]
OutputLabels: [1×1 struct]
InputVisible: {'on'}
OutputVisible: {'on'}
Title: [1×1 struct]
XLabel: [1×1 struct]
YLabel: [1×1 struct]
TickLabel: [1×1 struct]
Grid: 'off'
GridColor: [0.15 0.15 0.15]
XLim: {[1 10]}
YLim: {[1 10]}
XLimMode: {'auto'}
YLimMode: {'auto'}
set(ax,...
'XGrid', PlotOptions.Grid,...
'YGrid', PlotOptions.Grid,...
'XColor', PlotOptions.TickLabel.Color,...
'YColor', PlotOptions.TickLabel.Color,...
'FontSize', PlotOptions.TickLabel.FontSize,...
'FontWeight', PlotOptions.TickLabel.FontWeight,...
'FontAngle', PlotOptions.TickLabel.FontAngle,...
'Selected', 'off')
So, whether you hold your axes or not, the grids will be cleared. As you've discovered, you can add them back in after calling sigma().
0 Comments
Sign in to comment.