File: xs2eps.sci

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (55 lines) | stat: -rw-r--r-- 1,571 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
function xs2eps(win_num,filename,colored,orientation)
  [lhs,rhs]=argn(0);
  
  //Input arguments checking
  if rhs<3 then
    orientation='portrait'
    colored=-1
  elseif rhs==3 then
    if or(type(colored)==[1 4]) then
      orientation='portrait'
    elseif type(colored)==10 then
      orientation=colored
      colored=-1
    else
      error('Third argument should be the orientation or the colored flag')
    end
  elseif rhs==4 then
    if ~or(type(colored)==[1 4 10]) then
      error('Third argument should be the orientation or the colored flag')
    end
    if type(colored)==10 then
      [orientation,colored]=(colored,orientation)
    end
  end
  
  if and(type(colored)<>[1 4]) then
    error('the colored argument should be an integer or a boolean')
  end
  if type(orientation)<>10 then
    error('the orientation argument should be a character string')
  end
  
  opt='-'+part(stripblanks(orientation),1)
  if and(opt<>['-p','-l']) then 
    error('orientation should be ""p"" or ""l"" ')
  end
  
  //create the postscript file (without header)
  if colored==-1 then
    xs2ps(win_num,filename)
  else
    xs2ps(win_num,filename,bool2s(colored));
  end
  //add the Postscript file header and create <filename>.eps file
  if MSDOS then
    fname=pathconvert(filename,%f,%t,'w')
    comm=pathconvert(SCI+'\bin\BEpsf',%f,%f,'w')
    rep=unix_g(comm+' '+opt+' '+'""'+fname+'""')
  else
    rep=unix_g(SCI+'/bin/BEpsf '+opt+' '+filename)
  end
  if rep<>[] then 
    error('Problem generating file , perhaps directory is not writable')
  end
endfunction