This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
...intPath>LocalRestoreContentChangessubfunction6
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
200
if pt.AxesFreezeLimits
60 s0%
194
if pt.AxesFreezeTicks
60 s0%
14
if pt.VersionNumber > 1
60 s0%
9
if pt.DebugMode
60 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
10DISP(SPRINTF(...)) can usually be replaced by FPRINTF(...).
11Terminate statement with semicolon to suppress output (in functions).
Coverage results
Show coverage for parent directory
Total lines in function203
Non-code lines (comments, blank lines)24
Code lines (lines that can run)179
Code lines that did run4
Code lines that did not run175
Coverage (did run/can run)2.23 %
Function listing
time 
calls 
 line
   1 
function ptrestorehg( pt, h )
   2 
%FORMAT Method that restores a Figure after formatting it for output.
   3 
%   Input of PrintTemplate object and a Figure to modify.
   4 
%   Figure has numerous properties restore to previous values modified
   5 
%   to account for template settings.
   6 

   7 
%   Copyright 1984-2014 The MathWorks, Inc.
   8 

      6 
   9 
if pt.DebugMode 
  10 
    disp(sprintf(getString(message('MATLAB:uistring:ptrestorehg:RestoringFigure', num2str(double(h))))))
  11 
    pt
  12 
end
  13 

      6 
  14 
if pt.VersionNumber > 1 
  15 
    hgdata = pt.v2hgdata;
  16 
    % Get all the text and lines
  17 
    allAxes = hgdata.AllAxes;
  18 
    allText = hgdata.AllText;
  19 
    allPrimitiveText = hgdata.AllPrimitiveText;
  20 
    allLine = hgdata.AllLine;
  21 
    allColor = hgdata.AllColor;
  22 
    allMarker = hgdata.AllMarker;
  23 
    allEdge = hgdata.AllEdge;
  24 
    allFace = hgdata.AllFace;
  25 
    allLineObj = hgdata.AllLineObj;
  26 
    allCData = hgdata.AllCData;
  27 
    allCData2d = hgdata.AllCData2d;
  28 
    isvalidaxes = ishandle(allAxes);
  29 
    isvalidtext = ishandle(allText);
  30 
    isvalidprimitivetext = ishandle(allPrimitiveText);
  31 
    isvalidline = ishandle(allLine);
  32 
    isvalidlineobj = isvalid(allLineObj); % ishandle(allLineObj) fails for baseline objects
  33 
    isvalidcolor = isvalid(allColor); % ishandle(allColor); fails for baseline objects
  34 
    isvalidmarker = ishandle(allMarker);
  35 
    isvalidedge= ishandle(allEdge);
  36 
    isvalidface= ishandle(allFace);
  37 
    isvalidcdata = ishandle(allCData);
  38 
    isvalidcdata2d = ishandle(allCData2d);
  39 
    allAxes = allAxes(isvalidaxes);
  40 
    allText = allText(isvalidtext);
  41 
    allPrimitiveText = allPrimitiveText(isvalidprimitivetext);
  42 
    allLine = allLine(isvalidline);
  43 
    allColor = allColor(isvalidcolor);
  44 
    allMarker = allMarker(isvalidmarker);
  45 
    allEdge = allEdge(isvalidedge);
  46 
    allFace = allFace(isvalidface);
  47 
    allLineObj = allLineObj(isvalidlineobj);
  48 
    allCData = allCData(isvalidcdata);
  49 
    allCData2d = allCData2d(isvalidcdata2d);
  50 

  51 
    if ~isempty(allPrimitiveText)
  52 
        if isfield(hgdata, 'primitivetextbackgroundcolor')
  53 
            set(allPrimitiveText, {'BackgroundColor'}, hgdata.primitivetextbackgroundcolor(isvalidprimitivetext));
  54 
        end
  55 
        if isfield(hgdata, 'primitivetextbackgroundcolormode')
  56 
            set(allPrimitiveText, {'BackgroundColorMode'}, hgdata.primitivetextbackgroundcolormode(isvalidprimitivetext));
  57 
        end
  58 
    end
  59 

  60 

  61 
    if ~isempty(allText)
  62 
        if isfield(hgdata, 'fontname')
  63 
            set(allText, {'FontName'}, hgdata.fontname(isvalidtext));
  64 
        end
  65 
        if isfield(hgdata, 'fontnamemode')
  66 
            set(allText, {'FontNameMode'}, hgdata.fontnamemode(isvalidtext));
  67 
        end
  68 
        if isfield(hgdata, 'fontsize')
  69 
            set(allText, {'FontSize'}, hgdata.fontsize(isvalidtext));
  70 
        end
  71 
        if isfield(hgdata, 'fontsizemode')
  72 
            set(allText, {'FontSizeMode'}, hgdata.fontsizemode(isvalidtext));
  73 
        end
  74 
        if isfield(hgdata, 'fontweight')
  75 
            set(allText, {'FontWeight'}, hgdata.fontweight(isvalidtext));
  76 
        end
  77 
        if isfield(hgdata, 'fontweightmode')
  78 
            set(allText, {'FontWeightMode'}, hgdata.fontweightmode(isvalidtext));
  79 
        end
  80 
        if isfield(hgdata, 'fontangle')
  81 
            set(allText, {'FontAngle'}, hgdata.fontangle(isvalidtext));
  82 
        end
  83 
        if isfield(hgdata, 'fontanglemode')
  84 
            set(allText, {'FontAngleMode'}, hgdata.fontanglemode(isvalidtext));
  85 
        end
  86 
        if isfield(hgdata, 'fontcolor')
  87 
            set(allText, {'Color'}, hgdata.fontcolor(isvalidtext));
  88 
        end
  89 
        if isfield(hgdata, 'fontcolormode')
  90 
            set(allText, {'ColorMode'}, hgdata.fontcolormode(isvalidtext));
  91 
        end
  92 
    end
  93 
    
  94 
    if ~isempty(allLineObj)
  95 
        if isfield(hgdata, 'linewidth')
  96 
            set(allLineObj, {'LineWidth'}, hgdata.linewidth(isvalidlineobj));
  97 
        end
  98 
        if isfield(hgdata, 'linewidthmode')
  99 
            set(allLineObj, {'LineWidthMode'}, hgdata.linewidthmode(isvalidlineobj));
 100 
        end
 101 
    end
 102 

 103 
    if ~isempty(allLine)
 104 
        if isfield(hgdata, 'linecolor')
 105 
            set(allLine, {'Color'}, hgdata.linecolor(isvalidline));
 106 
        end
 107 
        if isfield(hgdata, 'linecolormode')
 108 
            set(allLine, {'ColorMode'}, hgdata.linecolormode(isvalidline));
 109 
        end
 110 
        
 111 
        if isfield(hgdata, 'linestyle')
 112 
            set(allLine, {'LineStyle'}, hgdata.linestyle(isvalidline));
 113 
        end
 114 
        if isfield(hgdata, 'linestylemode')
 115 
            set(allLine, {'LineStyleMode'}, hgdata.linestylemode(isvalidline));
 116 
        end
 117 
    end
 118 
    % backout grayscale and other colors as required 
 119 
    if isfield(hgdata, 'cdata2d')    
 120 
        set(allCData2d, {'CData'}, hgdata.cdata2d(isvalidcdata2d));
 121 
    end 
 122 
    if isfield(hgdata, 'cdata2dmode')    
 123 
        set(allCData2d, {'CDataMode'}, hgdata.cdata2dmode(isvalidcdata2d));
 124 
    end 
 125 
    if isfield(hgdata, 'cdata')    
 126 
        set(allCData, {'CData'}, hgdata.cdata(isvalidcdata));
 127 
    end 
 128 
    if isfield(hgdata, 'cdatamode')    
 129 
        set(allCData, {'CDataMode'}, hgdata.cdatamode(isvalidcdata));
 130 
    end 
 131 
    if isfield(hgdata, 'facecolor')    
 132 
        set(allFace, {'FaceColor'}, hgdata.facecolor(isvalidface));
 133 
    end
 134 
    if isfield(hgdata, 'facecolormode')    
 135 
        set(allFace, {'FaceColorMode'}, hgdata.facecolormode(isvalidface));
 136 
    end
 137 
    if isfield(hgdata, 'edgecolor')    
 138 
        set(allEdge, {'EdgeColor'}, hgdata.edgecolor(isvalidedge));
 139 
    end
 140 
    if isfield(hgdata, 'edgecolormode')    
 141 
        set(allEdge, {'EdgeColorMode'}, hgdata.edgecolormode(isvalidedge));
 142 
    end
 143 
    if isfield(hgdata, 'markerfacecolor')    
 144 
        set(allMarker, {'MarkerFaceColor'}, hgdata.markerfacecolor(isvalidmarker));
 145 
    end
 146 
    if isfield(hgdata, 'markerfacecolormode')    
 147 
        set(allMarker, {'MarkerFaceColorMode'}, hgdata.markerfacecolormode(isvalidmarker));
 148 
    end
 149 
    if isfield(hgdata, 'markeredgecolor')    
 150 
        set(allMarker, {'MarkerEdgeColor'}, hgdata.markeredgecolor(isvalidmarker));
 151 
    end
 152 
    if isfield(hgdata, 'markeredgecolormode')    
 153 
        set(allMarker, {'MarkerEdgeColorMode'}, hgdata.markeredgecolormode(isvalidmarker));
 154 
    end
 155 
    if isfield(hgdata, 'zcolor')    
 156 
        LocalSetValues(allAxes, {'ZColor'}, hgdata.zcolor(isvalidaxes));
 157 
    end
 158 
    if isfield(hgdata, 'zcolormode')    
 159 
        LocalSetValues(allAxes, {'ZColorMode'}, hgdata.zcolormode(isvalidaxes));
 160 
    end
 161 
    if isfield(hgdata, 'ycolor')    
 162 
        LocalSetValues(allAxes, {'YColor'}, hgdata.ycolor(isvalidaxes));
 163 
    end
 164 
    if isfield(hgdata, 'ycolormode')    
 165 
        LocalSetValues(allAxes, {'YColorMode'}, hgdata.ycolormode(isvalidaxes));
 166 
    end
 167 
    if isfield(hgdata, 'xcolor')    
 168 
        LocalSetValues(allAxes, {'XColor'}, hgdata.xcolor(isvalidaxes));
 169 
    end
 170 
    if isfield(hgdata, 'xcolormode')    
 171 
        LocalSetValues(allAxes, {'XColorMode'}, hgdata.xcolormode(isvalidaxes));
 172 
    end
 173 
    if isfield(hgdata, 'color')    
 174 
        LocalSetValues(allColor, {'Color'}, hgdata.color(isvalidcolor));
 175 
    end
 176 
    if isfield(hgdata, 'colormode')    
 177 
        LocalSetValues(allColor, {'ColorMode'}, hgdata.colormode(isvalidcolor));
 178 
    end
 179 
    % Restore the colormap of the figure and other colors
 180 
    if isfield(hgdata, 'colormap')    
 181 
        set(h, 'Colormap', hgdata.colormap);
 182 
    end
 183 

 184 
    % Restore BKColor
 185 
    if isfield(hgdata, 'bkcolor')
 186 
	   set(h, 'Color', hgdata.bkcolor);
 187 
    end
 188 
    if isfield(hgdata, 'bkcolormode')
 189 
	   set(h, 'ColorMode', hgdata.bkcolormode);
 190 
    end
 191 
end
 192 

 193 
% Output Axes with same tick MARKS as on screen
      6 
 194 
if pt.AxesFreezeTicks 
 195 
    LocalSetValues( pt.tickState.handles, {'XTickMode','YTickMode','ZTickMode'}, pt.tickState.values )
 196 
    pt.tickState = {};
 197 
end
 198 

 199 
% Output Axes with same tick LIMITS as on screen
      6 
 200 
if pt.AxesFreezeLimits 
 201 
    LocalSetValues( pt.limState.handles, {'XLimMode','YLimMode','ZLimMode'}, pt.limState.values )
 202 
    pt.limState = {};
 203 
end

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