time | Calls | line |
---|
| | 98 | function fig = ObserveFigureNextPlot(fig, hsave)
|
| | 99 | %
|
| | 100 | % Helper fcn for preparing figure for nextplot, optionally
|
| | 101 | % preserving specific existing descendants.
|
| | 102 | % GUARANTEED to return a figure, even if some crazy combination
|
| | 103 | % of create / delete fcns deletes it.
|
| | 104 |
|
< 0.001 | 2 | 105 | switch fig.NextPlot
|
< 0.001 | 2 | 106 | case 'new'
|
| | 107 | % if someone calls plot(x,y,'parent',h) and h is an axes
|
| | 108 | % in a figure with NextPlot 'new', ignore the 'new' and
|
| | 109 | % treat it as 'add' - just add the axes to that figure.
|
| | 110 | if isempty(hsave)
|
| | 111 | fig = figure;
|
| | 112 | end
|
< 0.001 | 2 | 113 | case 'replace'
|
| | 114 | clf(fig, 'reset', hsave);
|
< 0.001 | 2 | 115 | case 'replacechildren'
|
| | 116 | clf(fig, hsave);
|
< 0.001 | 2 | 117 | case 'add'
|
< 0.001 | 2 | 118 | % nothing
|
< 0.001 | 2 | 119 | end
|
< 0.001 | 2 | 120 | if ~any(ishghandle(fig)) && isempty(hsave)
|
| | 121 | fig = figure;
|
| | 122 | end
|
Other subfunctions in this file are not included in this listing.