time | calls | line |
---|
| | 81 | function fig = ObserveFigureNextPlot(fig, hsave)
|
| | 82 | %
|
| | 83 | % Helper fcn for preparing figure for nextplot, optionally
|
| | 84 | % preserving specific existing descendants.
|
| | 85 | % GUARANTEED to return a figure, even if some crazy combination
|
| | 86 | % of create / delete fcns deletes it.
|
| | 87 | %
|
0.29 | 6629 | 88 | switch get(fig,'nextplot')
|
0.04 | 6629 | 89 | case 'new'
|
| | 90 | % if someone calls plot(x,y,'parent',h) and h is an axes
|
| | 91 | % in a figure with NextPlot 'new', ignore the 'new' and
|
| | 92 | % treat it as 'add' - just add the axes to that figure.
|
| | 93 | if isempty(hsave)
|
| | 94 | fig = figure;
|
| | 95 | end
|
0.01 | 6629 | 96 | case 'replace'
|
| | 97 | clf(fig, 'reset', hsave);
|
0.02 | 6629 | 98 | case 'replacechildren'
|
| | 99 | clf(fig, hsave);
|
| 6629 | 100 | case 'add'
|
| | 101 | % nothing
|
0.01 | 6629 | 102 | end
|
0.09 | 6629 | 103 | if ~any(ishghandle(fig)) && isempty(hsave)
|
| | 104 | fig = figure;
|
| | 105 | end
|
Other subfunctions in this file are not included in this listing.