File: _hold.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (37 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function _hold(varargin) 


i=1;
ax=get('current_axes');
cmd=[];
while i<=length(varargin)
   if typeof(varargin(i))=='pltlibH'
     if varargin(i).handle.type=='Axes'
       ax=varargin(i).handle;
     else
      _error("axis : handle should be an axes handle")
     end
     i=i+1;
   elseif or(varargin(i)==['on','off'])
     cmd=varargin(i);
     i=i+1;
   else
     _error('hold : unknown hold state (must be ''on'' or ''off'')')
  end
end

if cmd==[]
  if ax.user_data.nextPlot=='add'
    ax.user_data.nextPlot='erase'
    disp('Current plot released')
  else
    ax.user_data.nextPlot='add';
    disp('Current plot held')
  end
elseif cmd=='on'
  ax.user_data.nextPlot='add';
elseif cmd=='off'
  ax.user_data.nextPlot='erase';
end  

endfunction