File: _grid.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 (61 lines) | stat: -rw-r--r-- 1,104 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function _grid(varargin) 

[lhs,rhs]=argn(0);

[lhs,rhs]=argn(0);
vect=[];

i=1;
ax=get('current_axes');
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 type(varargin(i))==10
      out=parseOnOff("grid",varargin(i),"grid","");
      break;
   end 
end

if ~exists("out","local")
  cmd="toggle";
else
  cmd=out(2);
end

if rhs==1  
  if varargin(1)=='on'
    cmd="on";
  elseif varargin(1)=='off'
    cmd="off";
  else
    _error('hold : unknown hidden state (must be ''on'' or ''off'')')
  end
elseif rhs==0
  cmd="toggle";
end

out=list();

for ppty=["XGrid" "YGrid" "ZGrid"]
    _done=%f;
    if cmd=="on" | cmd=="toggle"
        if ax.user_data(ppty)=="off"
           out=lstcat(out,ppty,"on");
           _done=%t;
        end
    end  
    if cmd=="off" | (cmd=="toggle" & ~_done)
        if ax.user_data(ppty)=="on"
           out=lstcat(out,ppty,"off");
         end
    end
end

_update_axes(ax,out);

endfunction