File: plot.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (53 lines) | stat: -rw-r--r-- 1,411 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
function []=plot(x,y,legx,legy,leg)
// 
// For backward compatibility with some very old stuff
//! 
// Copyright INRIA
[lhs,rhs]=argn(0);
if rhs >=2,
   if type(y)==1, 
     if prod(size(x))<>prod(size(y)),
       write(%io(2),'x and y must have the same size');
       return;end
   end;
end;

select rhs,
  case 1 then 
        [nl,nk]=size(x);
        if nl==1|nk==1 then
        plot2d1("enn",1,matrix(x,prod(size(x)),1));
        else
        xbasc();plot2d((ones(nl,1)*(1:nk))',x')
        end
  case 2 then xbasc();
         if type(y)==10,
           plot2d1("enn",1,matrix(x,prod(size(x)),1));
           xtitle(' ',y,' ');
         else
           plot2d(matrix(x,prod(size(x)),1),matrix(y,prod(size(y)),1));
         end;
  case 3 then xbasc();
         if type(y)==10,
           plot2d1("enn",1,matrix(x,prod(size(x)),-1));
           xtitle(' ',y,legx);
         else 
           plot2d(matrix(x,prod(size(x)),1),matrix(y,prod(size(y)),1));
           xtitle(' ',legx,' ');
         end;
  case 4 then xbasc();
         if type(y)==10,
           plot2d1("enn",1,matrix(x,prod(size(x)),1));
           xtitle(legy,y,legx);
         else 
           plot2d(matrix(x,prod(size(x)),1),matrix(y,prod(size(y)),1));
           xtitle(' ',legx,legy);
         end;
  case 5 then xbasc();
           plot2d(matrix(x,prod(size(x)),1),matrix(y,prod(size(y)),1));
           xtitle(leg,legx,legy);
end