File: _legend.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-- 791 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 h=_legend(varargin)

win=get('current_figure');
ax=get('current_axes');
h=[];

IMD=win.immediate_drawing;
win.immediate_drawing='off';
i=1;
while i<=length(varargin)
   if typeof(varargin(i))=='pltlibH'
     if varargin(i).handle.type=='Axes'
       ax=varargin(i).handle;
     else
      _error('legend : handle should be an axes handle')
     end
     i=i+1;
   elseif typeof(varargin(i))=='string'
    select varargin(i)
    case 'show'
      h=processLegend(ax);
    case 'hide'      
      if type(ax.user_data.legendHandle)~=1
          ax.user_data.legendHandle.visible='off';
      end  
    else
      [mat,nbproc,typ]=parseLegend('legend',varargin,i);
      h=processLegend(ax,mat,typ);
      break;
    end
    i=i+1;
  end 
end
 
win.immediate_drawing=IMD;

endfunction