Differences From Artifact [09e22b156b]:

To Artifact [bec738695e]:


1

2
3
4
5
6
7
8
9
10

11
12
13
14
15
16



17
18
19
20
21
22
23

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
-
+









+






+
+
+







function figfig(filename,language,boxed,monochrome)
function figfig(filename,language,boxed,monochrome,key)
  ## Usage: figfig(filename[,language,boxed,monochrome])
  ## Puts octave figure into fig file (filename.fig)
  ## If second argument, converts to filename.language using fig2dev
  ## eg:
  ##    figfig("foo");
  ##    figfig("foo","eps");
  ##    figfig("foo","pdf");
  ## Boxed=1 gives a box around the figure
  ## Monochrome=1 gives a monchrome plot
  ## key=1 gives the key legend

  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.10  2003/08/19 13:13:28  gawthrop
  ## No legend
  ##
  ## Revision 1.9  2002/09/12 08:39:27  gawthrop
  ## Removed spurious text
  ##
  ## Revision 1.8  2002/09/11 15:04:59  gawthrop
  ## Optional boxing
  ##
  ## Revision 1.7  2002/08/20 15:51:17  gawthrop
39
40
41
42
43
44
45
46

47
48
49
50
51
52




53
54
55
56
57
58
59

60



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

81
82
83
84
85


86
43
44
45
46
47
48
49

50
51
52
53
54


55
56
57
58
59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
74

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

94
95
96







-
+




-
-
+
+
+
+







+
-
+
+
+





-














+




-
+
+

  ## *** empty log message ***
  ##
  ## Revision 1.1  2000/11/03 10:43:10  peterg
  ## Initial revision
  ###############################################################

  if nargin<3
    boxed=1;
    boxed=0;
  endif
  
  if nargin<4
    monochrome=0;
  else
    monochrome=1;
  endif
  
  if nargin<5
    key=0;
  endif
  
  
  figfilename = sprintf("%s.fig",filename);
  
  eval(sprintf("gset output \"%s\" ",figfilename));

  if key!=1
  gset nokey			# No legend
    gset nokey			# No legend
  endif
  
  if (monochrome==1)
    gset term fig monochrome portrait fontsize 16 size 20 10 metric thickness 3
  else
    gset term fig color portrait fontsize 16 size 20 10 metric thickness 3
  endif
  
  replot;
  gset term x11
  gset output
  replot;

  if boxed # Add a box - makes a visible bounding box
    fid = fopen(figfilename,"a+");
    fprintf(fid,"2 4 0 2 31 7 50 0 -1 0.000 0 0 7 0 0 5\n");
    fprintf(fid,"\t9675 5310 9675 270 225 270 225 5310 9675 5310\n");
    fclose(fid);
  endif
  

  if nargin>1			# Do a file in another langueage
    sleep(1);
    psfilename = sprintf("%s.%s",filename,language);
    convert = sprintf("fig2dev -L%s %s > %s", language, figfilename, psfilename);
    system(convert);
  endif
  

  gset key			# Put it back
endfunction

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]