This is a static copy of a profile report

Home

printing/private/adjustGridLineStyles (Calls: 22, Time: 0.005 s)
Generated 16-Jul-2020 17:09:29 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/printing/private/adjustGridLineStyles.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
printing/private/printjobContentChangesfunction22
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
10
if ~(pj.temp.isPostscript &...
220.005 s87.9%
11
return; % only for truly vecto...
220.000 s3.1%
All other lines  0.000 s9.0%
Totals  0.005 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function40
Non-code lines (comments, blank lines)16
Code lines (lines that can run)24
Code lines that did run2
Code lines that did not run22
Coverage (did run/can run)8.33 %
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 
    
  0.005 
     22 
  10
   if ~(pj.temp.isPostscript &&  pj.temp.outputUsesPainters) 
< 0.001 
     22 
  11
       return; % only for truly vectorized postscript formats  
  12 
   end
  13 
   if strcmp(state, 'save')
  14 
       % save state, if needed  
  15 
       gridAx = findall(pj.Handles{1}, ...
  16 
           {'Type', 'axes', '-or', 'Type','polaraxes'}, ...
  17 
           'Visible', 'on', 'Layer', 'top', ...
  18 
           'GridLineStyleMode', 'auto', '-not', 'GridAlpha', 1);
  19 
       if ~isempty(gridAx)
  20 
           pj.temp.gridData.ax = gridAx;
  21 
           pj.temp.gridData.linestyle     = get(gridAx, 'GridLineStyle');
  22 
           pj.temp.gridData.linestyleMode = get(gridAx, 'GridLineStyleMode');
  23 
           % make sure to have cell arrays to make it easier to restore later
  24 
           if ~iscell(pj.temp.gridData.linestyle)
  25 
               pj.temp.gridData.linestyle = {pj.temp.gridData.linestyle};
  26 
               pj.temp.gridData.linestyleMode = {pj.temp.gridData.linestyleMode};
  27 
           end
  28 
           set(gridAx, 'GridLineStyle', ':');
  29 
           pj.temp.test.adjustGridLineStyles = 'set';
  30 
       end
  31 
   else
  32 
       % restore previously saved values 
  33 
       if isfield(pj.temp, 'gridData') && ~isempty(pj.temp.gridData.ax)
  34 
          set(pj.temp.gridData.ax, {'GridLineStyle'}, pj.temp.gridData.linestyle);
  35 
          set(pj.temp.gridData.ax, {'GridLineStyleMode'}, pj.temp.gridData.linestyleMode);
  36 
          pj.temp.test.adjustGridLineStyles = 'restore';
  37 
       end
  38 
   end
  39 

  40 
end

Other subfunctions in this file are not included in this listing.