This is a static copy of a profile report

Home

graphics/private/adjustGridLineStyles (12 calls, 0.212 sec)
Generated 14-Nov-2016 07:47:19 using cpu time.
function in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/graphics/private/adjustGridLineStyles.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...PrintPath>LocalSetupContentChangessubfunction6
...intPath>LocalRestoreContentChangessubfunction6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
15
gridAx = findall(pj.Handles{1}...
30.192 s90.5%
30
if isfield(pj.temp, 'gridData'...
30.020 s9.5%
36
end
60 s0%
34
end
30 s0%
28
else
30 s0%
All other lines  0 s0%
Totals  0.212 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
findallfunction30.192 s90.5%
Self time (built-ins, overhead, etc.)  0.020 s9.5%
Totals  0.212 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function36
Non-code lines (comments, blank lines)14
Code lines (lines that can run)22
Code lines that did run9
Code lines that did not run13
Coverage (did run/can run)40.91 %
Function listing
time 
calls 
 line
   1 
function pj = adjustGridLineStyles(state, pj) 
   2 
% This undocumented helper function is for internal use.
   3 
   
   4 
% if doing postscript and axes layer is 'top', and alpha is not 1 (opaque) 
   5 
% then we want to change the GridLineStyle to ':' so it looks decent in 
   6 
% output because postscript doesn't support transparency 
   7 

   8 
%   Copyright 2014 The MathWorks, Inc.
   9 
    
     12 
  10 
   if ~(pj.temp.isPostscript &&  pj.temp.outputUsesPainters) 
      6 
  11 
       return; % only for truly vectorized postscript formats  
  12 
   end
      6 
  13 
   if strcmp(state, 'save') 
  14 
       % save state, if needed  
  0.19 
      3 
  15 
       gridAx = findall(pj.Handles{1}, 'type', 'axes', 'Visible', 'on', 'Layer', 'top', ... 
  16 
           'GridLineStyleMode', 'auto', '-not', 'GridAlpha', 1);
      3 
  17 
       if ~isempty(gridAx) 
  18 
           pj.temp.gridData.ax = gridAx;
  19 
           pj.temp.gridData.linestyle     = get(gridAx, 'GridLineStyle');
  20 
           pj.temp.gridData.linestyleMode = get(gridAx, 'GridLineStyleMode');
  21 
           % make sure to have cell arrays to make it easier to restore later
  22 
           if ~iscell(pj.temp.gridData.linestyle)
  23 
               pj.temp.gridData.linestyle = {pj.temp.gridData.linestyle};
  24 
               pj.temp.gridData.linestyleMode = {pj.temp.gridData.linestyleMode};
  25 
           end
  26 
           set(gridAx, 'GridLineStyle', ':');
  27 
       end
      3 
  28 
   else 
  29 
       % restore previously saved values 
  0.02 
      3 
  30 
       if isfield(pj.temp, 'gridData') && ~isempty(pj.temp.gridData.ax) 
  31 
          set(pj.temp.gridData.ax, {'GridLineStyle'}, pj.temp.gridData.linestyle);
  32 
          set(pj.temp.gridData.ax, {'GridLineStyleMode'}, pj.temp.gridData.linestyleMode);
  33 
       end
      3 
  34 
   end 
  35 

      6 
  36 
end