This is a static copy of a profile report

Home

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

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
24
oldTickLimit = printingAxesTic...
120.162 s96.7%
21
newStyle = printingConvertToEx...
120.003 s2.1%
30
if pt.VersionNumber > 1
120.000 s0.2%
25
v1hgdata.oldTickLimit = oldTic...
120.000 s0.2%
27
pt.v1hgdata = v1hgdata;
120.000 s0.1%
All other lines  0.001 s0.7%
Totals  0.167 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
printing/.../printingAxesTickLabelUpdatefunction120.161 s96.5%
.../private/printingConvertToExportStylefunction120.003 s1.8%
Self time (built-ins, overhead, etc.)  0.003 s1.7%
Totals  0.167 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function79
Non-code lines (comments, blank lines)34
Code lines (lines that can run)45
Code lines that did run13
Code lines that did not run32
Coverage (did run/can run)28.89 %
Function listing
time 
Calls 
 line
   1 
function pt = ptpreparehg( pt, h )
   2 
%PREPAREHG Method of PrintTemplate object that formats a Figure for output.
   3 
%   Input of PrintTemplate object and a Figure to modify on.
   4 
%   Figure has numerous properties modified to account for template settings.
   5 

   6 
%   Copyright 1984-2018 The MathWorks, Inc.
   7 

< 0.001 
     12 
   8
if pt.DebugMode 
   9 
    fprintf(getString(message('MATLAB:uistring:ptpreparehg:PreparingFigure', num2str(double(h)))));
  10 
    disp(pt); 
< 0.001 
     12 
  11
end 
  12 

  13 
% Initialize structure which used to store objects, property and
  14 
% corresponding original values throughout the process
< 0.001 
     12 
  15
oldTickLimit.objs = {}; 
< 0.001 
     12 
  16
oldTickLimit.prop = {}; 
< 0.001 
     12 
  17
oldTickLimit.values = {}; 
  18 

< 0.001 
     12 
  19
v1hgdata = []; 
  20 

  0.003 
     12 
  21
newStyle = printingConvertToExportStyle(pt); 
  22 

  23 
% Update Axes/Ruler Tick/Limit mode values, and store original values
  0.162 
     12 
  24
oldTickLimit = printingAxesTickLabelUpdate(h, newStyle, oldTickLimit); 
< 0.001 
     12 
  25
v1hgdata.oldTickLimit = oldTickLimit; 
  26 

< 0.001 
     12 
  27
pt.v1hgdata = v1hgdata; 
  28 

  29 
% try
< 0.001 
     12 
  30
if pt.VersionNumber > 1 
  31 
    
  32 
    % Get all necessary objects to process
  33 
    objCollections = printingObjectCollection(h);
  34 
    
  35 
    try
  36 
        err = 0;
  37 
        
  38 
        % Initialize structure which used to store objects, property and
  39 
        % corresponding original values throughout the process
  40 
        old.objs = {};
  41 
        old.prop = {};
  42 
        old.values = {};
  43 
        
  44 
        % Process Font
  45 
        old = printingFontUpdate(objCollections.allFont, newStyle, old);
  46 
        
  47 
        % Process Line
  48 
        old = printingLineUpdate(objCollections.line, newStyle, old);
  49 
        
  50 
        if isfield(pt,'DriverColor')
  51 
            if pt.DriverColor == 1 && isfield(pt, 'GrayScale') && pt.GrayScale==1
  52 
                old = printingGrayscaleUpdate(objCollections, old);
  53 
            end
  54 
        end
  55 
        
  56 
        if strcmp('off', get(h,'InvertHardcopy')) && isfield(pt, 'BkColor') && ~isempty(pt.BkColor)
  57 
            hgdata.bkcolor = get(h, 'Color');
  58 
            if any(pt.BkColor == '[')
  59 
                % use str2num to convert the string array of values into a
  60 
                % double array
  61 
                pt.BkColor = str2num(pt.BkColor); %#ok<ST2NM>
  62 
            end
  63 
            hgdata.bkcolormode = get(h, 'ColorMode');
  64 
            set(h, 'Color', pt.BkColor');
  65 
        end
  66 
    catch ex
  67 
        err = 1;
  68 
    end
  69 
    hgdata.old = old;
  70 
    pt.v2hgdata = hgdata;
  71 
    
  72 
    % If there's a failure, still propagate the error up. But roll back all
  73 
    % changes made to the figure FIRST.
  74 
    if err
  75 
        ptrestorehg( pt, h );
  76 
        rethrow( ex );
  77 
    end
< 0.001 
     12 
  78
end 
< 0.001 
     12 
  79
end 

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