This is a static copy of a profile report

Home

Function details for graphics/private/ptpreparehgThis is a static copy of a profile report

Home

graphics/private/ptpreparehg (Calls: 1, Time: 0.013 s)
Generated 02-May-2020 21:54:34 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/graphics/private/ptpreparehg.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
graphics/private/printjobContentChangesfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
24
oldTickLimit = printingAxesTic...
10.010 s76.6%
21
newStyle = printingConvertToEx...
10.002 s15.4%
30
if pt.VersionNumber > 1
10.000 s1.0%
17
oldTickLimit.values = {};
10.000 s1.0%
8
if pt.DebugMode
10.000 s0.8%
All other lines  0.001 s5.2%
Totals  0.013 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graphics/.../printingAxesTickLabelUpdatefunction10.010 s74.3%
.../private/printingConvertToExportStylefunction10.002 s12.6%
Self time (built-ins, overhead, etc.)  0.002 s13.0%
Totals  0.013 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 run11
Code lines that did not run34
Coverage (did run/can run)24.44 %
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-2017 The MathWorks, Inc.
   7 

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

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

< 0.001 
      1 
  19
v1hgdata = []; 
  20 

  0.002 
      1 
  21
newStyle = printingConvertToExportStyle(pt); 
  22 

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

< 0.001 
      1 
  27
pt.v1hgdata = v1hgdata; 
  28 

  29 
% try
< 0.001 
      1 
  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
  78 
end
< 0.001 
      1 
  79
end 

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