This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
LOH_hapmap_v4function6396
specgraph/...te/areaHGUsingMATLABClassesfunction37
angle_plot_subfiguresscript62
allelic_ratios_WGseqfunction134
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
73
ax = ObserveAxesNextPlot(ax, h...
66291.129 s43.6%
63
fig = ObserveFigureNextPlot(fi...
66290.595 s23.0%
65
set(fig,'nextplot','add');
66290.373 s14.4%
68
ax = gca(fig);
66290.141 s5.4%
60
fig = gcf;
66290.111 s4.3%
All other lines  0.242 s9.3%
Totals  2.590 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
newplot>ObserveAxesNextPlotsubfunction66291.089 s42.0%
newplot>ObserveFigureNextPlotsubfunction66290.554 s21.4%
Self time (built-ins, overhead, etc.)  0.947 s36.6%
Totals  2.590 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function77
Non-code lines (comments, blank lines)45
Code lines (lines that can run)32
Code lines that did run16
Code lines that did not run16
Coverage (did run/can run)50.00 %
Function listing
time 
calls 
 line
   1 
function axReturn = newplot(hsave)
   2 
%NEWPLOT Prepares figure, axes for graphics according to NextPlot.
   3 
%   H = NEWPLOT returns the handle of the prepared axes.
   4 
%   H = NEWPLOT(HSAVE) prepares and returns an axes, but does not
   5 
%   delete any objects whose handles appear in HSAVE. If HSAVE is
   6 
%   specified, the figure and axes containing HSAVE are prepared
   7 
%   instead of the current axes of the current figure. If HSAVE is
   8 
%   empty, NEWPLOT behaves as if it were called without any inputs.
   9 
%
  10 
%   NEWPLOT is a standard preamble command that is put at
  11 
%   the beginning of graphics functions that draw graphs
  12 
%   using only low-level object creation commands. NEWPLOT
  13 
%   "does the right thing" in terms of determining which axes and/or
  14 
%   figure to draw the plot in, based upon the setting of the
  15 
%   NextPlot property of axes and figure objects, and returns a
  16 
%   handle to the appropriate axes.
  17 
%
  18 
%   The "right thing" is:
  19 
%
  20 
%   First, prepare a figure for graphics:
  21 
%   Clear and reset the current figure using CLF RESET if its NextPlot
  22 
%   is 'replace', or clear the current figure using CLF if its
  23 
%   NextPlot is 'replacechildren', or reuse the current figure as-is
  24 
%   if its NextPlot is 'add', or if no figures exist, create a figure.
  25 
%   When the figure is prepared, set its NextPlot to 'add', and then
  26 
%   prepare an axes in that figure:
  27 
%   Clear and reset the current axes using CLA RESET if its NextPlot
  28 
%   is 'replace', or clear the current axes using CLA if its NextPlot
  29 
%   is 'replacechildren', or reuse the current axes as-is if its
  30 
%   NextPlot is 'add', or if no axes exist, create an axes.
  31 
%
  32 
%   See also HOLD, ISHOLD, FIGURE, AXES, CLA, CLF.
  33 

  34 
%   Copyright 1984-2010 The MathWorks, Inc.
  35 
%   Built-in function.
  36 

   6629 
  37 
if nargin == 0 || isempty(hsave) 
  0.03 
   6629 
  38 
    hsave = []; 
  39 
elseif ~isscalar(hsave) || ~ishghandle(hsave)
  40 
    error(message('MATLAB:newplot:InvalidHandle'))
  41 
end
  42 

  43 

  0.01 
   6629 
  44 
fig = []; 
   6629 
  45 
ax = []; 
  46 

  0.03 
   6629 
  47 
if ~isempty(hsave) 
  48 
    obj = hsave;
  49 
    while ~isempty(obj)
  50 
        if strcmp(get(obj,'type'),'figure')
  51 
            fig = obj;
  52 
        elseif strcmp(get(obj,'type'),'axes')
  53 
            ax = obj;
  54 
        end
  55 
        obj = get(obj,'parent');
  56 
    end
  57 
end
  58 

   6629 
  59 
if isempty(fig) 
  0.11 
   6629 
  60 
    fig = gcf; 
  0.01 
   6629 
  61 
end 
  62 

  0.59 
   6629 
  63 
fig = ObserveFigureNextPlot(fig, hsave); 
  64 
% for clay
  0.37 
   6629 
  65 
set(fig,'nextplot','add'); 
  66 

  0.01 
   6629 
  67 
if isempty(ax) 
  0.14 
   6629 
  68 
    ax = gca(fig); 
  69 
elseif ~any(ishghandle(ax))
  70 
    error(message('MATLAB:newplot:NoAxesParent'))
  71 
end
  72 

  1.13 
   6629 
  73 
ax = ObserveAxesNextPlot(ax, hsave); 
  74 

  0.02 
   6629 
  75 
if nargout 
  0.02 
   6629 
  76 
    axReturn = ax; 
  0.02 
   6629 
  77 
end 

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