This is a static copy of a profile report

Home

legend>make_legend (2 calls, 0.881 sec)
Generated 18-Mar-2011 23:31:45 using cpu time.
M-subfunction in file /Applications/MATLAB_R2010a.app/toolbox/matlab/scribe/legend.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
legendM-function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
389
lh=scribe.legend(ha,orient,loc...
20.477 s54.1%
357
children = graph2dhelper ('get...
20.342 s38.8%
374
if isappdata(child,'LegendLege...
3720.021 s2.4%
343
if ~is2D(ha)
20.021 s2.4%
387
[children,strings,warnmsg] = c...
20.010 s1.2%
All other lines  0.010 s1.2%
Totals  0.881 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
scribe.legend.legendM-function20.477 s54.1%
graph2dhelperM-function20.342 s38.8%
is2DM-function20.021 s2.4%
legend>check_legend_stringsM-subfunction20.010 s1.2%
legend>process_inputsM-subfunction20.010 s1.2%
opaque.doubleM-function20 s0%
legend>find_legendM-subfunction20 s0%
Self time (built-ins, overhead, etc.)  0.021 s2.4%
Totals  0.881 s100% 
M-Lint results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function69
Non-code lines (comments, blank lines)18
Code lines (lines that can run)51
Code lines that did run28
Code lines that did not run23
Coverage (did run/can run)54.90 %
Function listing
   time   calls  line
326 function [leg,warnmsg] = make_legend(ha,argin)
327
328 % find and delete existing legend
2 329 leg = find_legend(ha);
2 330 if ~isempty(leg)
331 delete_legend(leg);
332 end
333 % process args
0.01 2 334 [orient,location,position,children,listen,strings,propargs] = process_inputs(ha,argin);
335
336 % set position if empty
2 337 if isempty(position)
2 338 position = -1;
2 339 end
340
341 % set location if empty
2 342 if isempty(location)
0.02 2 343 if ~is2D(ha)
344 location = 'NorthEastOutside';
2 345 else
2 346 location = 'NorthEast';
2 347 end
2 348 end
349 % check prop val args
2 350 if ~isempty(propargs)
351 check_pv_args(propargs);
352 end
353 % get children if empty
2 354 auto_children = false;
2 355 if isempty(children)
2 356 auto_children = true;
0.34 2 357 children = graph2dhelper ('get_legendable_children', ha, false);
358 % if still no children, return empty
2 359 if isempty(children)
360 warnmsg = struct('identifier',id('PlotEmpty'),...
361 'message','Plot empty.');
362 hfig=ancestor(ha,'figure');
363 ltogg = uigettool(hfig,'Annotation.InsertLegend');
364 if ~isempty(ltogg)
365 set(ltogg,'State','off');
366 end
367 leg = [];
368 return;
369 end
2 370 end
2 371 for k=1:length(children)
372 372 child = children(k);
372 373 leginfo = getappdata(child,'LegendLegendInfo');
0.02 372 374 if isappdata(child,'LegendLegendInfo') && ...
375 (isempty(leginfo) || ~ishandle(leginfo))
376 try
377 setLegendInfo(handle(child));
378 catch ex %#ok<NASGU>
379 lis = getappdata(child, 'LegendLegendInfoStruct');
380 if ~isempty(lis)
381 legendinfo(child, lis{:});
382 end
383 end
384 end
372 385 end
386 % fill in strings if needed
0.01 2 387 [children,strings,warnmsg] = check_legend_strings(children,strings,auto_children);
388 % create legend
0.48 2 389 lh=scribe.legend(ha,orient,location,position,children,listen,strings,propargs{:});
390 % convert to double
2 391 leg=double(lh);
392
393 % Inform basic fitting that legend is ready
2 394 send(lh, 'LegendConstructorDone', handle.EventData(handle(lh), 'LegendConstructorDone'));

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