~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/xdess/loadplots.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function rec=loadplots(fil)
 
2
//Given a file generated by xsave of by the save menu in graphic window
 
3
//this function returns a data structure containing the plot definition
 
4
//
 
5
// rec is a typed list with type "SPLOT" each of the 2:n fiels  contains
 
6
// a graphic instruction definition and parameters
 
7
// for example if a user saves the graphics generated by xbasc();plot2d()
 
8
//in the file foo.scg
 
9
//  rec=loadplots('foo.scg') is a data structure such that rec(9) defines
 
10
//  the plot2d parameters. rec(9)(1) gives the structure field names
 
11
//
 
12
// For simple cases txt=string(rec) generates the Scilab instruction
 
13
// which reproduce the plot. To make the necessary functions known load
 
14
// the loadplots function first for exmaple with the instruction 
 
15
//loadplots;
 
16
//
 
17
// Copyright INRIA
 
18
// Author: Serge Steer  
 
19
  ufil=mopen(fil,'rb')
 
20
  rec=tlist('SPLOT')
 
21
  SciF_version=LoadVectC()
 
22
  while %t do
 
23
    //posi=mtell(ufil);
 
24
    typ=LoadVectC();//disp(typ)
 
25
    if typ=='endplots' then break,end
 
26
    rec($+1)=LoadTPlot(typ);
 
27
  end
 
28
  mclose(ufil)
 
29
endfunction
 
30
 
 
31
function rec=LoadTPlot(typ)
 
32
// Copyright INRIA
 
33
// Author: Serge Steer
 
34
 
 
35
  // The table here is translated from routines/graphics/RecLoad.c
 
36
  table=["axis","LoadSciAxis"
 
37
         "champ","LoadChamp"
 
38
         "colormap","LoadColormap"
 
39
         "contour","LoadContour"
 
40
         "contour2","LoadContour2D"
 
41
         "fac3d","LoadFac3D"
 
42
         "fac3d1","LoadFac3D"
 
43
         "fac3d2","LoadFac3D"
 
44
         "fac3d3","LoadFac3D"
 
45
         "fec_n","LoadFec_n"
 
46
         "fec","LoadFec"
 
47
         "gray","LoadGray"
 
48
         "gray1","LoadGray1"
 
49
         "gray2","LoadGray2"
 
50
         "nscale","LoadNEch"
 
51
         "param3d","LoadParam3D"
 
52
         "param3d1","LoadParam3D1"
 
53
         "plot2d","LoadPlot"
 
54
         "plot3d","LoadPlot3D"
 
55
         "plot3d1","LoadPlot3D"
 
56
         "scale","LoadEch"
 
57
         "xcall1","LoadXcall1"
 
58
         "xgrid","LoadGrid"]
 
59
  k=find(typ==table(:,1))
 
60
  if k==[] then
 
61
    error('LoadTPlot, unknown key '+typ)
 
62
  else
 
63
    execstr('rec='+table(k,2)+'()')
 
64
  end
 
65
endfunction
 
66
 
 
67
function rec=LoadXcall1()
 
68
// Copyright INRIA
 
69
// Author: Serge Steer
 
70
 
 
71
// The structure definition is translated from routines/graphics/RecLoad.c
 
72
 
 
73
  rec=xcall1_rec()
 
74
  rec.fname=LoadVectC()
 
75
  rec.string=LoadVectC()
 
76
  rec.n1=LoadLI()
 
77
  rec.n2=LoadLI()
 
78
  rec.n3=LoadLI()
 
79
  rec.n4=LoadLI()
 
80
  rec.n5=LoadLI()
 
81
  rec.n6=LoadLI()
 
82
  rec.ndx1=LoadLI()
 
83
  rec.ndx2=LoadLI()
 
84
  rec.ndx3=LoadLI()
 
85
  rec.ndx4=LoadLI()
 
86
  rec.x1=LoadVectLI()
 
87
  rec.x2=LoadVectLI()
 
88
  rec.x3=LoadVectLI()
 
89
  rec.x4=LoadVectLI()
 
90
  rec.x5=LoadVectLI()
 
91
  rec.x6=LoadVectLI()
 
92
  rec.dx1=LoadVectF()
 
93
  rec.dx2=LoadVectF()
 
94
  rec.dx3=LoadVectF()
 
95
  rec.dx4=LoadVectF()
 
96
  if rec.fname=='xstringa' then
 
97
    // in fact xtitle 
 
98
    str=rec.string
 
99
    rec=xtitle_rec()
 
100
    rec.strs=[str,"",""]
 
101
    for k=1:2
 
102
      pos=mtell(ufil)
 
103
      fname=LoadVectC()
 
104
      if fname<>'xcall1' then
 
105
        mseek(pos,ufil,'set')
 
106
        return
 
107
      else
 
108
        fname=LoadVectC()
 
109
        if fname<>'xstringa' then
 
110
          mseek(pos,ufil,'set')
 
111
          return
 
112
        end
 
113
        rec.strs(k+1)=LoadVectC()
 
114
        for i=1:10,LoadLI(),end
 
115
        for i=1:6,LoadVectLI(),end
 
116
        for i=1:4,LoadVectF(),end
 
117
      end
 
118
    end
 
119
  end
 
120
endfunction
 
121
 
 
122
function rec=LoadEch()
 
123
// Copyright INRIA
 
124
// Author: Serge Steer
 
125
 
 
126
// The structure definition is translated from routines/graphics/RecLoad.c
 
127
  
 
128
  rec=scale_rec()
 
129
  rec.logflag=LoadC()
 
130
  rec.name=LoadVectC()
 
131
  rec.Wrect=LoadVectF()
 
132
  rec.Frect=LoadVectF()
 
133
  rec.Frect_kp=LoadVectF()
 
134
endfunction
 
135
 
 
136
function rec=LoadNEch()
 
137
// Copyright INRIA
 
138
// Author: Serge Steer
 
139
 
 
140
// The structure definition is translated from routines/graphics/RecLoad.c
 
141
  
 
142
  rec=nscale_rec()
 
143
  rec.logflag=LoadC()
 
144
  rec.name=LoadVectC()
 
145
  rec.flag=LoadVectC()
 
146
  rec.Wrect=LoadVectF()
 
147
  rec.Frect=LoadVectF()
 
148
  rec.Arect=LoadVectF()
 
149
  rec.Frect_kp=LoadVectF()
 
150
endfunction
 
151
function rec=LoadColormap()
 
152
// Copyright INRIA
 
153
// Author: Serge Steer
 
154
 
 
155
// The structure definition is translated from routines/graphics/RecLoad.c
 
156
  
 
157
  rec=colormap_rec()
 
158
  nc=LoadLI()
 
159
  rec.cmap=matrix(mget(3*nc,'db',ufil),-1,3)
 
160
endfunction
 
161
 
 
162
function rec=LoadPlot()
 
163
// Copyright INRIA
 
164
// Author: Serge Steer
 
165
 
 
166
// The structure definition is translated from routines/graphics/RecLoad.c
 
167
  
 
168
  rec=plot2d_rec();
 
169
  rec.n1=LoadLI();
 
170
  rec.n2=LoadLI();
 
171
  rec.name=LoadVectC();
 
172
  rec.xf=LoadVectC();
 
173
  if part(rec.xf,1)=='g' then 
 
174
    nx=rec.n1*rec.n2,
 
175
  elseif  part(rec.xf,1)=='o' then 
 
176
    nx=rec.n2
 
177
  else
 
178
    nx=0
 
179
  end
 
180
  if nx<>0 then
 
181
    rec.x=LoadVectF();
 
182
  else
 
183
    rec.x=[]
 
184
  end
 
185
  rec.y=LoadVectF();
 
186
  rec.style=LoadVectLI()
 
187
  rec.strflag=LoadVectC()
 
188
  rec.strflag_kp=LoadVectC()
 
189
  rec.legend=LoadVectC()
 
190
 
 
191
  rec.brect=LoadVectF()
 
192
  rec.brect_kp=LoadVectF()
 
193
  rec.aint=LoadVectLI()
 
194
  rec.aint_kp=LoadVectLI()
 
195
endfunction
 
196
 
 
197
function rec=LoadSciAxis()
 
198
// Copyright INRIA
 
199
// Author: Serge Steer
 
200
 
 
201
// The structure definition is translated from routines/graphics/RecLoad.c
 
202
  
 
203
  rec=sciaxis_rec()
 
204
  typ=LoadC()
 
205
  rec.nx=LoadLI()
 
206
  rec.ny=LoadLI()
 
207
  rec.sub_int=LoadLI()
 
208
  rec.fontsize=LoadLI()
 
209
  rec.textcolor=LoadLI()
 
210
  rec.ticscolor=LoadLI()
 
211
  rec.seg=LoadLI()
 
212
  rec.f_l=LoadLI()
 
213
  rec.name=LoadVectC()
 
214
  if rec.f_l==1 then
 
215
    rec.format_n=LoadVectC()
 
216
  else
 
217
    rec.format_n=''
 
218
  end
 
219
  rec.x=LoadVectF()
 
220
  rec.y=LoadVectF()
 
221
  rec.str=LoadVectS()
 
222
  rec.dir=part(typ,1)
 
223
  rec.tics=part(typ,2)
 
224
  rec.logflag=part(typ,3)
 
225
endfunction
 
226
 
 
227
function rec=LoadGrid()
 
228
// Copyright INRIA
 
229
// Author: Serge Steer
 
230
 
 
231
// The structure definition is translated from routines/graphics/RecLoad.c
 
232
  
 
233
  rec=xgrid_rec()
 
234
  rec.style=LoadLI()
 
235
  rec.name=LoadVectC()
 
236
endfunction
 
237
 
 
238
function rec=LoadParam3D()
 
239
// Copyright INRIA
 
240
// Author: Serge Steer
 
241
 
 
242
// The structure definition is translated from routines/graphics/RecLoad.c
 
243
  
 
244
  rec=param3d_rec()
 
245
  rec.n=LoadLI()
 
246
  rec.teta=LoadD()
 
247
  rec.alpha=LoadD()
 
248
  rec.name=LoadVectC()
 
249
  rec.x=LoadVectF()
 
250
  rec.y=LoadVectF()
 
251
  rec.z=LoadVectF()
 
252
  rec.legend=LoadVectC()
 
253
  rec.flag=LoadVectLI()
 
254
  rec.bbox=LoadVectF()
 
255
endfunction
 
256
 
 
257
function rec=LoadParam3D1()
 
258
// Copyright INRIA
 
259
// Author: Serge Steer
 
260
 
 
261
// The structure definition is translated from routines/graphics/RecLoad.c
 
262
  
 
263
  rec=param3d1_rec()
 
264
  rec.m=LoadLI()
 
265
  rec.n=LoadLI()
 
266
  rec.iflag=LoadLI()
 
267
  if rec.iflag==1 then
 
268
    rec.colors=LoadVectLI()
 
269
  else
 
270
    rec.colors=[]
 
271
  end
 
272
  rec.teta=LoadD()
 
273
  rec.alpha=LoadD()
 
274
  rec.name=LoadVectC()
 
275
  rec.x=LoadVectF()
 
276
  rec.y=LoadVectF()
 
277
  rec.z=LoadVectF()
 
278
  rec.legend=LoadVectC()
 
279
  rec.flag=LoadVectLI()
 
280
  rec.bbox=LoadVectF()
 
281
endfunction
 
282
 
 
283
function rec=LoadPlot3D()
 
284
// Copyright INRIA
 
285
// Author: Serge Steer
 
286
 
 
287
// The structure definition is translated from routines/graphics/RecLoad.c
 
288
  
 
289
  rec=plot3d_rec()
 
290
  rec.p=LoadLI()
 
291
  rec.q=LoadLI()
 
292
  rec.teta=LoadD()
 
293
  rec.alpha=LoadD()
 
294
  rec.name=LoadVectC()
 
295
  rec.x=LoadVectF()
 
296
  rec.y=LoadVectF()
 
297
  rec.z=LoadVectF()
 
298
  rec.legend=LoadVectC()
 
299
  rec.flag=LoadVectLI()
 
300
  rec.bbox=LoadVectF()
 
301
endfunction
 
302
 
 
303
function rec=LoadFac3D()
 
304
// Copyright INRIA
 
305
// Author: Serge Steer
 
306
 
 
307
// The structure definition is translated from routines/graphics/RecLoad.c
 
308
  
 
309
  rec=fac3d_rec()
 
310
  rec.p=LoadLI()
 
311
  rec.q=LoadLI()
 
312
  rec.teta=LoadD()
 
313
  rec.alpha=LoadD()
 
314
  rec.name=LoadVectC()
 
315
  if rec.name=='fac3d2'|  rec.name=='fac3d2' then
 
316
    rec.cvect=LoadVectLI()
 
317
  else
 
318
    rec.cvect=[]
 
319
  end
 
320
 
 
321
  rec.x=LoadVectF()
 
322
  rec.y=LoadVectF()
 
323
  rec.z=LoadVectF()
 
324
  rec.legend=LoadVectC()
 
325
  rec.flag=LoadVectLI()
 
326
  rec.bbox=LoadVectF()
 
327
endfunction
 
328
 
 
329
 
 
330
function rec=LoadFec()
 
331
// Copyright INRIA
 
332
// Author: Serge Steer
 
333
 
 
334
// The structure definition is translated from routines/graphics/RecLoad.c
 
335
  
 
336
  rec=fec_rec();
 
337
  rec.Nnode=LoadLI();;
 
338
  rec.Ntr=LoadLI();
 
339
  rec.name=LoadVectC();
 
340
  rec.x=LoadVectF();
 
341
  rec.y=LoadVectF();
 
342
  rec.triangles=LoadVectF();
 
343
  rec.func=LoadVectF();
 
344
  rec.brect=LoadVectF();
 
345
  rec.brect_kp=LoadVectF();
 
346
  rec.aaint=LoadVectLI();
 
347
  rec.aaint_kp=LoadVectLI();
 
348
  rec.strflag=LoadVectC();
 
349
  rec.strflag_kp=LoadVectC();
 
350
  rec.legend=LoadVectC();
 
351
  rec.zminmax=[LoadD(),LoadD()];
 
352
  rec.colminmax=[LoadLI(),LoadLI()];
 
353
endfunction
 
354
 
 
355
function rec=LoadFec_n()
 
356
// Copyright INRIA
 
357
// Author: Serge Steer
 
358
 
 
359
// The structure definition is translated from routines/graphics/RecLoad.c
 
360
  
 
361
  rec=fec_rec();
 
362
  rec.Nnode=LoadLI();;
 
363
  rec.Ntr=LoadLI();
 
364
  rec.name=LoadVectC();
 
365
  rec.x=LoadVectF();
 
366
  rec.y=LoadVectF();
 
367
  rec.triangles=LoadVectF();
 
368
  rec.func=LoadVectF();
 
369
  rec.brect=LoadVectF();
 
370
  rec.brect_kp=LoadVectF();
 
371
  rec.zminmax=LoadVectF();
 
372
  rec.colminmax=LoadVectLI();
 
373
  rec.aaint=LoadVectLI();
 
374
  rec.aaint_kp=LoadVectLI();
 
375
  rec.strflag=LoadVectC();
 
376
  rec.strflag_kp=LoadVectC();
 
377
  rec.legend=LoadVectC();
 
378
endfunction
 
379
 
 
380
function rec=LoadContour()
 
381
// Copyright INRIA
 
382
// Author: Serge Steer
 
383
 
 
384
// The structure definition is translated from routines/graphics/RecLoad.c
 
385
  
 
386
  rec=contour_rec()
 
387
  rec.n1=LoadLI()
 
388
  rec.n2=LoadLI()
 
389
  rec.nz=LoadLI()
 
390
  rec.flagnz=LoadLI()
 
391
  if rec.flagnz<>0 then
 
392
    rec.zz=LoadVectF()
 
393
  else
 
394
    rec.zz=[]
 
395
  end
 
396
  rec.teta=LoadD()
 
397
  rec.alpha=LoadD()
 
398
  rec.zlev=LoadD()
 
399
  rec.name=LoadVectC()
 
400
  rec.x=LoadVectF()
 
401
  rec.y=LoadVectF()
 
402
  rec.z=LoadVectF()
 
403
  rec.legend=LoadVectC()
 
404
  rec.flag=LoadVectLI()
 
405
  rec.bbox=LoadVectF()
 
406
endfunction
 
407
 
 
408
function rec=LoadContour2D()
 
409
// Copyright INRIA
 
410
// Author: Serge Steer
 
411
 
 
412
// The structure definition is translated from routines/graphics/RecLoad.c
 
413
  
 
414
  rec=contour2d_rec()
 
415
  rec.n1=LoadLI()
 
416
  rec.n2=LoadLI()
 
417
  rec.nz=LoadLI()
 
418
  rec.flagnz=LoadLI()
 
419
  if rec.flagnz<>0 then
 
420
    rec.zz=LoadVectF()
 
421
  else
 
422
    rec.zz=[]
 
423
  end
 
424
  rec.name=LoadVectC()
 
425
  rec.x=LoadVectF()
 
426
  rec.y=LoadVectF()
 
427
  rec.z=LoadVectF()
 
428
  rec.style=LoadVectLI()
 
429
  rec.strflag=LoadVectC()
 
430
  rec.strflag_kp=LoadVectC()
 
431
  rec.legend=LoadVectC()
 
432
  rec.brect=LoadVectF()
 
433
  rec.brect_kp=LoadVectF()
 
434
  rec.aint=LoadVectLI()
 
435
  rec.aint_kp=LoadVectLI()
 
436
endfunction
 
437
 
 
438
function rec= LoadGray()
 
439
// Copyright INRIA
 
440
// Author: Serge Steer
 
441
 
 
442
// The structure definition is translated from routines/graphics/RecLoad.c
 
443
  
 
444
  rec=gray_rec()
 
445
  rec.n1=LoadLI()
 
446
  rec.n2=LoadLI()
 
447
  rec.name=LoadVectC()
 
448
  rec.x=LoadVectF()
 
449
  rec.y=LoadVectF()
 
450
  rec.z=LoadVectF()
 
451
  rec.strflag=LoadVectC()
 
452
  rec.strflag_kp=LoadVectC()
 
453
  rec.brect=LoadVectF()
 
454
  rec.brect_kp=LoadVectF()
 
455
  rec.aint=LoadVectLI()
 
456
  rec.aint_kp=LoadVectLI()
 
457
endfunction
 
458
 
 
459
function rec= LoadGray1()
 
460
// Copyright INRIA
 
461
// Author: Serge Steer
 
462
 
 
463
// The structure definition is translated from routines/graphics/RecLoad.c
 
464
  
 
465
  rec=gray_rec()
 
466
  rec.n1=LoadLI()
 
467
  rec.n2=LoadLI()
 
468
  rec.name=LoadVectC()
 
469
  rec.z=LoadVectF()
 
470
  rec.strflag=LoadVectC()
 
471
  rec.strflag_kp=LoadVectC()
 
472
  rec.brect=LoadVectF()
 
473
  rec.brect_kp=LoadVectF()
 
474
  rec.aint=LoadVectLI()
 
475
  rec.aint_kp=LoadVectLI()
 
476
endfunction
 
477
 
 
478
function rec= LoadGray2()
 
479
// Copyright INRIA
 
480
// Author: Serge Steer
 
481
 
 
482
// The structure definition is translated from routines/graphics/RecLoad.c
 
483
  
 
484
  rec=gray_rec_2()
 
485
  rec.n1=LoadLI()
 
486
  rec.n2=LoadLI()
 
487
  rec.name=LoadVectC()
 
488
  rec.z=LoadVectF()
 
489
  rec.xrect=LoadVectF()
 
490
endfunction
 
491
function rec=LoadChamp()
 
492
// Copyright INRIA
 
493
// Author: Serge Steer
 
494
 
 
495
// The structure definition is translated from routines/graphics/RecLoad.c
 
496
  
 
497
  rec=champ_rec()
 
498
  rec.n1=LoadLI()
 
499
  rec.n2=LoadLI()
 
500
  rec.arfact=LoadD()
 
501
  rec.name=LoadVectC()
 
502
  rec.x=LoadVectF()
 
503
  rec.y=LoadVectF()
 
504
  rec.fx=LoadVectF()
 
505
  rec.fy=LoadVectF()
 
506
  rec.strflag=LoadVectC()
 
507
  rec.strflag_kp=LoadVectC()
 
508
  rec.vrect=LoadVectF()
 
509
  rec.vrect_kp=LoadVectF()
 
510
endfunction
 
511
 
 
512
function n=LoadLI()
 
513
// Copyright INRIA
 
514
// Author: Serge Steer
 
515
 
 
516
// Emulate the C procedure in routines/graphics/RecLoad.c
 
517
 
 
518
  n=mget(1,'ib',ufil)
 
519
endfunction
 
520
 
 
521
function str=LoadVectC()
 
522
// Copyright INRIA
 
523
// Author: Serge Steer
 
524
 
 
525
// Emulate the C procedure in routines/graphics/RecLoad.c
 
526
  
 
527
  n1=mget(1,'uib',ufil)
 
528
  //q=int(n1/4);r=n1-4*q
 
529
  n=n1
 
530
  if modulo(n1,4)<>0 then n=4*(int(n1/4)+1),end
 
531
  c=mget(n,'uc',ufil)
 
532
  if n1-1>size(c) then pause,end
 
533
  str=ascii(c(1:n1-1))
 
534
endfunction
 
535
 
 
536
function x=LoadVectF()
 
537
// Copyright INRIA
 
538
// Author: Serge Steer
 
539
 
 
540
// Emulate the C procedure in routines/graphics/RecLoad.c
 
541
  
 
542
  n=mget(1,'uib',ufil)
 
543
  x=mget(n,'db',ufil)
 
544
endfunction
 
545
 
 
546
function i=LoadVectLI()
 
547
// Copyright INRIA
 
548
// Author: Serge Steer
 
549
 
 
550
// Emulate the C procedure in routines/graphics/RecLoad.c
 
551
  
 
552
  n=mget(1,'uib',ufil)
 
553
  i=mget(n,'ib',ufil)
 
554
endfunction
 
555
 
 
556
function x=LoadD()
 
557
 // Copyright INRIA
 
558
// Author: Serge Steer
 
559
 
 
560
// Emulate the C procedure in routines/graphics/RecLoad.c
 
561
 
 
562
  x=mget(1,'db',ufil)
 
563
endfunction
 
564
 
 
565
function x=LoadC()
 
566
// Copyright INRIA
 
567
// Author: Serge Steer
 
568
 
 
569
// Emulate the C procedure in routines/graphics/RecLoad.c
 
570
 
 
571
  n1=mget(1,'uib',ufil)
 
572
  n=n1
 
573
  if modulo(n1,4)<>0 then n=4*(int(n1/4)+1),end
 
574
  c=mget(n,'uc',ufil)
 
575
  if n1-1>size(c) then pause,end
 
576
  x=ascii(c(1:n1-1))
 
577
endfunction
 
578
 
 
579
function x=LoadVectS()
 
580
// Copyright INRIA
 
581
// Author: Serge Steer
 
582
 
 
583
// Emulate the C procedure in routines/graphics/RecLoad.c
 
584
  
 
585
  n=mget(1,'uib',ufil)
 
586
  x=[]
 
587
  for k=1:n
 
588
    x=[x;LoadC()]
 
589
  end
 
590
endfunction
 
591
 
 
592
function rec=plot2d_rec()
 
593
// Copyright INRIA
 
594
// Author: Serge Steer
 
595
 
 
596
  
 
597
  rec=tlist(['plot2d','n1','n2','name','xf','x','y','style','strflag',..
 
598
             'strflag_kp','legend','brect','brect_kp','aint','aint_kp'])
 
599
endfunction
 
600
 
 
601
function rec=plot3d_rec()
 
602
// Copyright INRIA
 
603
// Author: Serge Steer
 
604
  
 
605
  rec=tlist(['plot3d','p','q','teta','alpha','name','x','y','z',..
 
606
             'legend','flag','bbox'])
 
607
endfunction
 
608
 
 
609
function rec= xcall1_rec()
 
610
// Copyright INRIA
 
611
// Author: Serge Steer
 
612
  
 
613
  rec=tlist(['xcall1','fname' 'string' 'n1' 'n2' 'n3' 'n4' 'n5' 'n6',..
 
614
             'ndx1' 'ndx2' 'ndx3' 'ndx4' 'x1' 'x2' 'x3' 'x4' 'x5' 'x6' ,..
 
615
             'dx1' 'dx2' 'dx3' 'dx4'])
 
616
endfunction
 
617
function rec= xtitle_rec()
 
618
// Copyright INRIA
 
619
// Author: Serge Steer
 
620
  rec=tlist(['xtitle','strs'])
 
621
endfunction
 
622
 
 
623
function rec=scale_rec()
 
624
// Copyright INRIA
 
625
// Author: Serge Steer
 
626
  
 
627
  rec=tlist(['scale','logflag','name','Wrect','Frect','Frect_kp'])
 
628
endfunction
 
629
 
 
630
function rec=nscale_rec()
 
631
// Copyright INRIA
 
632
// Author: Serge Steer
 
633
  
 
634
  rec=tlist(['nscale','logflag','name','flag','Wrect','Frect','Arect','Frect_kp'])
 
635
endfunction
 
636
 
 
637
function rec=sciaxis_rec()
 
638
// Copyright INRIA
 
639
// Author: Serge Steer
 
640
  
 
641
  rec=tlist(['sciaxis','nx' 'ny' 'sub_int' 'fontsize' 'textcolor' ,..
 
642
             'ticscolor' 'seg' 'f_l' 'name' 'format_n' 'x' 'y' 'str' ..
 
643
             'dir' 'tics' 'logflag'])
 
644
endfunction
 
645
 
 
646
function rec=xgrid_rec()
 
647
// Copyright INRIA
 
648
// Author: Serge Steer
 
649
  
 
650
  rec=tlist(['xgrid','style','name'])
 
651
endfunction
 
652
function rec=param3d_rec()
 
653
// Copyright INRIA
 
654
// Author: Serge Steer
 
655
  
 
656
  rec=tlist(['param3d','n','teta' 'alpha' 'name',..
 
657
             'x' 'y' 'z' 'legend' 'flag','bbox'])
 
658
endfunction
 
659
 
 
660
function rec=param3d1_rec()
 
661
// Copyright INRIA
 
662
// Author: Serge Steer
 
663
  
 
664
  rec=tlist(['param3d1','m','n','iflag','colors','teta' 'alpha' 'name',..
 
665
             'x' 'y' 'z' 'legend' 'flag' 'bbox'])
 
666
endfunction
 
667
 
 
668
function rec=fac3d_rec()
 
669
// Copyright INRIA
 
670
// Author: Serge Steer
 
671
  
 
672
  rec=tlist(['fac3d','p','q','teta','alpha','name','cvect','x','y','z',..
 
673
             'legend','flag','bbox'])
 
674
endfunction
 
675
 
 
676
function rec=fec_rec()
 
677
// Copyright INRIA
 
678
// Author: Serge Steer
 
679
  
 
680
  rec=tlist(['fec','Nnode','Ntr','name','x','y','triangles','func','brect',..
 
681
             'brect_kp','aaint','aaint_kp','strflag','strflag_kp','legend',..
 
682
            'zminmax','colminmax'])
 
683
endfunction
 
684
 
 
685
function rec=colormap_rec()
 
686
// Copyright INRIA
 
687
// Author: Serge Steer
 
688
  
 
689
  rec=tlist(['colormap','cmap'])
 
690
endfunction
 
691
 
 
692
function rec=contour_rec()
 
693
// Copyright INRIA
 
694
// Author: Serge Steer
 
695
  
 
696
  rec=tlist(['contour','n1','n2','nz','flagnz','zz','teta','alpha','zlev',..
 
697
             'name','x','y','z','legend','flag','bbox'])
 
698
endfunction
 
699
 
 
700
function rec=contour2d_rec()
 
701
// Copyright INRIA
 
702
// Author: Serge Steer
 
703
  
 
704
  rec=tlist(['contour2d','n1','n2','nz','flagnz','zz',..
 
705
             'name','x','y','z','style','strflag','strflag_kp','legend','brect',..
 
706
             'brect_kp','aint','aint_kp'])
 
707
endfunction
 
708
 
 
709
function rec=gray_rec()
 
710
// Copyright INRIA
 
711
// Author: Serge Steer
 
712
   
 
713
  rec=tlist(['gray','n1','n2','name','x','y','z','style',..
 
714
             'strflag','strflag_kp','legend','brect',..
 
715
             'brect_kp','aint','aint_kp'])
 
716
endfunction
 
717
 
 
718
function rec=gray_rec_2()
 
719
// Copyright INRIA
 
720
// Author: Serge Steer
 
721
  
 
722
  rec=tlist(['gray2','n1','n2','name','z','xrect'])
 
723
endfunction
 
724
 
 
725
function rec=champ_rec()
 
726
// Copyright INRIA
 
727
// Author: Serge Steer
 
728
  
 
729
  rec=tlist(['contour2d','n1','n2','arfact',..
 
730
             'name','x','y','fx','fy','strflag','strflag_kp','vrect',..
 
731
             'vrect_kp'])
 
732
endfunction
 
733
 
 
734
function txt=%xcall1_string(rec)
 
735
// Copyright INRIA
 
736
// Author: Serge Steer
 
737
  
 
738
  select rec.fname
 
739
    case 'xset' then
 
740
    txt='xset(""'+rec.string+'""'
 
741
    if or(rec.string==["alufunction","background","dashes","foreground",..
 
742
                       "hidden3d","line mode","pattern","pixmap","thickness",..
 
743
                       "use color","window","wresize","clipgrf","color",..
 
744
                       "line style"]) then
 
745
      txt=txt+','+string(rec.x1)+')'
 
746
    elseif or(rec.string==["default","wshow","wwpc","clipoff"]) then
 
747
      txt=txt+')'
 
748
    elseif or(rec.string==["font","mark","wdim","wpos","viewport"]) then
 
749
      txt=txt+','+string(rec.x1)+','+string(rec.x2)+')'
 
750
    elseif or(rec.string==["clipping"]) then
 
751
      txt=txt+','+string(rec.dx1)+','+string(rec.dx2)+','+string(rec.dx3)+..
 
752
          ','+string(rec.dx4)+')'
 
753
    elseif or(rec.string==["auto clear"]) then  
 
754
      if rec.n1==1 then 
 
755
        txt=txt+',""on"")'
 
756
      else
 
757
        txt=txt+',""off"")'
 
758
      end
 
759
    else
 
760
      txt=txt+',???)'
 
761
    end
 
762
    case 'xrect' then
 
763
    txt='xrect('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
764
        sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
 
765
        sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
 
766
    case 'xrects' then  
 
767
    m=rec.ndx1
 
768
    txt=[sci2exp(matrix(rec.dx1,-1,4),'x')
 
769
         'xrects(x)']
 
770
    case 'xfrect' then
 
771
    txt='xfrect('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
772
        sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
 
773
        sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
 
774
    case 'xpolys' then
 
775
    dr=sci2exp(rec.x3)
 
776
    m=rec.ndx1
 
777
    txt=[sci2exp(matrix(rec.dx1,m,-1),'x')
 
778
         sci2exp(matrix(rec.dx2,m,-1),'y')
 
779
         'xpolys(x,y,'+dr+')']
 
780
    case 'xstring' then
 
781
    txt='xstring('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
782
        sci2exp(rec.string,0)+','+sci2exp(rec.dx3,0)+')'
 
783
    case 'xstringb' then
 
784
    txt='xstringb('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
785
        sci2exp(rec.string,0)+','+sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
 
786
 
 
787
    case 'xsegs' then
 
788
    m=rec.ndx1
 
789
    style=sci2exp(rec.x1,0)
 
790
    txt=[sci2exp(matrix(rec.dx1,m,-1),'x',0)
 
791
         sci2exp(matrix(rec.dx2,m,-1),'y',0)
 
792
         'xsegs(x,y,'+style+')']
 
793
    case 'xarrow' then
 
794
    txt=[]
 
795
    case 'xarc' then
 
796
    txt='xarc('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
797
        sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+','+..
 
798
        sci2exp(rec.x5,0)+','+sci2exp(rec.x6,0)+')'
 
799
    case 'xarcs' then
 
800
    n=rec.n3
 
801
    txt=[sci2exp(matrix(rec.dx1,6,-1),'arcs',0)
 
802
         'xarcs(arcs,'+sci2exp(rec.x2,0)+')']
 
803
    case 'xfarc' then
 
804
        txt='xfarc('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
 
805
            sci2exp(rec.dx3)+','+sci2exp(rec.dx4,0)+','+..
 
806
            sci2exp(rec.x5,0)+','+sci2exp(rec.x6,0)+')'
 
807
    case 'xfarcs' then 
 
808
        txt=[sci2exp(matrix(rec.dx1,6,-1),'arcs',0)
 
809
         'xfarcs(arcs,'+sci2exp(rec.x2,0)+')']
 
810
    case 'xaxis' then
 
811
        txt=['xaxis('+sci2exp(rec.dx1,0)+','+sci2exp(rec.x2,0)+','+..
 
812
             sci2exp(rec.dx2,0)+','+sci2exp(rec.dx3,0)+')']
 
813
    case 'xlines' then
 
814
        txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
 
815
             ',''lines'','+sci2exp(rec.x4,0)+')']
 
816
    case 'xarea' then
 
817
        txt=['xfpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
 
818
             ','+sci2exp(rec.x4,0)+')']
 
819
            
 
820
 
 
821
    case 'xliness' then
 
822
    txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
 
823
             ',''lines'','+sci2exp(rec.x4,0)+')']
 
824
        
 
825
    case 'xmarks' then
 
826
        txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
 
827
             ',''marks'','+sci2exp(rec.x4,0)+')']
 
828
  else
 
829
    error('%xcall1_string, unknown keyword: '+rec.fname)
 
830
  end
 
831
endfunction
 
832
 
 
833
function %xcall1_p(rec)
 
834
// Copyright INRIA
 
835
// Author: Serge Steer
 
836
 
 
837
  disp(string(rec))
 
838
endfunction
 
839
 
 
840
function txt=%xtitle_string(rec)
 
841
// Copyright INRIA
 
842
// Author: Serge Steer
 
843
  txt='xtitle('+sci2exp(rec.strs(1))+','+sci2exp(rec.strs(2))+','+..
 
844
      sci2exp(rec.strs(3))+')'
 
845
endfunction
 
846
 
 
847
function %xtitle_p(rec)
 
848
// Copyright INRIA
 
849
// Author: Serge Steer
 
850
  disp(%xtitle_string(rec))
 
851
endfunction
 
852
 
 
853
 
 
854
function txt=%plot2d_string(rec)
 
855
// Copyright INRIA
 
856
// Author: Serge Steer
 
857
 
 
858
  txt=[]
 
859
  n1=rec.n1
 
860
  n2=rec.n2
 
861
 
 
862
  rec.x=matrix(rec.x,n2,-1)
 
863
  txt=[txt;sci2exp(rec.x,'x')];txt($)=txt($)+';';x='x';
 
864
 
 
865
  rec.y=matrix(rec.y,n2,-1)
 
866
  txt=[txt;sci2exp(rec.y,'y')];txt($)=txt($)+';';y='y';
 
867
 
 
868
  txt=[txt;rec.name+'(""'+rec.xf+'"",'+x+','+y+','+sci2exp(rec.style)+',""'+..
 
869
       rec.strflag+'"",""'+rec.legend+'"",'+sci2exp(rec.brect)+','+..
 
870
       sci2exp(rec.aint)+')']
 
871
endfunction
 
872
 
 
873
function %plot2d_p(rec)
 
874
// Copyright INRIA
 
875
// Author: Serge Steer
 
876
  
 
877
  disp(string(rec))
 
878
endfunction
 
879
 
 
880
function txt=%plot3d_string(rec)
 
881
// Copyright INRIA
 
882
// Author: Serge Steer
 
883
  
 
884
  txt=[]
 
885
 
 
886
  p=rec.p
 
887
  q=rec.q
 
888
  
 
889
  if size(rec.x,'*')<>p then rec.x=matrix(rec.x,p,q),end
 
890
  txt=[txt;sci2exp(rec.x,'x')]
 
891
  x='x'
 
892
 
 
893
  if size(rec.y,'*')<>p then rec.y=matrix(rec.y,p,q),end
 
894
  txt=[txt;sci2exp(rec.y,'y')]
 
895
  y='y'
 
896
 
 
897
 
 
898
  txt=[txt;sci2exp(matrix(rec.z,p,q),'z')]
 
899
  z='z'
 
900
 
 
901
 
 
902
  txt=[txt;rec.name+'('+x+','+y+','+z+','+sci2exp(rec.teta)+','+..
 
903
       sci2exp(rec.alpha)+',""'+rec.legend+'"",'+sci2exp(rec.flag)+','+..
 
904
       sci2exp(rec.bbox)+')']
 
905
endfunction
 
906
 
 
907
function %plot3d_p(rec)
 
908
// Copyright INRIA
 
909
// Author: Serge Steer
 
910
  
 
911
  disp(string(rec))
 
912
endfunction
 
913
 
 
914
function txt=%fac3d_string(rec)
 
915
// Copyright INRIA
 
916
// Author: Serge Steer
 
917
  
 
918
  txt=[]
 
919
 
 
920
  p=rec.p
 
921
  q=rec.q
 
922
 
 
923
  rec.x=matrix(rec.x,p,q)
 
924
  txt=[txt;sci2exp(rec.x,'x')]
 
925
  x='x'
 
926
 
 
927
  rec.y=matrix(rec.y,p,q)
 
928
  txt=[txt;sci2exp(rec.y,'y')]
 
929
  y='y'
 
930
 
 
931
  txt=[txt;sci2exp(matrix(rec.z,p,q),'x')]
 
932
  z='z'
 
933
 
 
934
  txt=[txt;rec.name+'('+x+','+y+','+z+','+sci2exp(rec.teta)+','+..
 
935
       sci2exp(rec.alpha)+'""'+rec.legend+'"",'+sci2exp(rec.flag)+','+..
 
936
       sci2exp(rec.bbox)+')']
 
937
endfunction
 
938
 
 
939
function %fac3d_p(rec)
 
940
// Copyright INRIA
 
941
// Author: Serge Steer
 
942
  
 
943
  disp(string(rec))
 
944
endfunction
 
945
 
 
946
 
 
947
 
 
948
function %SPLOT_p(rec)
 
949
// Copyright INRIA
 
950
// Author: Serge Steer
 
951
  for k=2:size(rec)
 
952
    disp(rec(k))
 
953
  end
 
954
endfunction
 
955
 
 
956
function txt=%SPLOT_string(rec)
 
957
// Copyright INRIA
 
958
// Author: Serge Steer
 
959
  txt=[]
 
960
  for k=2:size(rec)
 
961
    txt=[txt;string(rec(k))]
 
962
  end
 
963
endfunction
 
964
 
 
965
function txt=%nscale_string(rec)
 
966
// Copyright INRIA
 
967
// Author: Serge Steer
 
968
  
 
969
  txt=[]
 
970
  if rec.logflag=='n' then rec.logflag='nn',end
 
971
  logflag=sci2exp(rec.logflag,'logflag')
 
972
  wrect=sci2exp(rec.Wrect,'wrect')
 
973
  frect=sci2exp(rec.Frect,'frect')
 
974
  arect=sci2exp(rec.Arect,'arect')
 
975
  txt='xsetech('+strcat([wrect,frect,arect,logflag],',')+')'
 
976
endfunction
 
977
 
 
978
function %nscale_p(rec)
 
979
// Copyright INRIA
 
980
// Author: Serge Steer
 
981
  
 
982
  disp(string(rec))
 
983
endfunction
 
984
 
 
985
function txt=%scale_string(rec)
 
986
// Copyright INRIA
 
987
// Author: Serge Steer
 
988
  
 
989
  txt=[]
 
990
  if rec.logflag=='n' then rec.logflag='nn',end
 
991
  logflag=sci2exp(rec.logflag,'logflag')
 
992
  wrect=sci2exp(rec.Wrect,'wrect')
 
993
  frect=sci2exp(rec.Frect,'frect')
 
994
  txt='xsetech('+strcat([wrect,frect,logflag],',')+')'
 
995
endfunction
 
996
 
 
997
function %scale_p(rec)
 
998
// Copyright INRIA
 
999
// Author: Serge Steer
 
1000
  
 
1001
  disp(string(rec))
 
1002
endfunction
 
1003
 
 
1004
 
 
1005
function txt=%colormap_string(rec)
 
1006
// Copyright INRIA
 
1007
// Author: Serge Steer
 
1008
  
 
1009
  txt=[sci2exp(rec.cmap,'cmap')
 
1010
      'xset('"colormap'",cmap)']
 
1011
endfunction
 
1012
 
 
1013
function %colormap_p(rec)
 
1014
// Copyright INRIA
 
1015
// Author: Serge Steer
 
1016
  
 
1017
  disp(string(rec))
 
1018
endfunction
 
1019
 
 
1020
function txt=%sciaxis_string(rec)
 
1021
 // Copyright INRIA
 
1022
// Author: Serge Steer
 
1023
 
 
1024
  f=['x';'y';'dir';'sub_int';'tics']
 
1025
  txt=[]
 
1026
  args=[]
 
1027
  for k=1:size(f,'*')
 
1028
    if size(rec(f(k)),'*')==1 then
 
1029
      args=[args sci2exp(rec(f(k)),f(k))]
 
1030
    else
 
1031
      txt=[txt;sci2exp(rec(f(k)),f(k))]
 
1032
      args=[args f(k)+'='+f(k)]
 
1033
    end
 
1034
  end
 
1035
  if rec.seg<>1 then
 
1036
    args=[args sci2exp(rec.seg,'seg')],
 
1037
  end
 
1038
  if length(rec.format_n)>0 then
 
1039
    args=[args sci2exp(rec.format_n,'format_n')]
 
1040
  end
 
1041
  if rec.textcolor<>-1 then
 
1042
    args=[args sci2exp(rec.textcolor,'textcolor')],
 
1043
  end
 
1044
  if rec.ticscolor<>-1 then
 
1045
    args=[args sci2exp(rec.ticscolor,'ticscolor')],
 
1046
  end
 
1047
  if rec.fontsize<>-1 then
 
1048
    args=[args sci2exp(rec.fontsize,'fontsize')],
 
1049
  end
 
1050
 
 
1051
  
 
1052
  txt=[txt;'drawaxis('+strcat(args,',')+')']
 
1053
 
 
1054
endfunction
 
1055
 
 
1056
function %sciaxis_p(rec)
 
1057
// Copyright INRIA
 
1058
// Author: Serge Steer
 
1059
  
 
1060
  disp(string(rec))
 
1061
endfunction
 
1062
 
 
1063
function txt=%param3d_string(rec)
 
1064
// Copyright INRIA
 
1065
// Author: Serge Steer
 
1066
  
 
1067
  n=rec.n
 
1068
  txt=[sci2exp(matrix(rec.x,n,-1),'x')
 
1069
       sci2exp(matrix(rec.y,n,-1),'y')
 
1070
       sci2exp(matrix(rec.z,n,-1),'z')]
 
1071
  args=['x';'y';'z';sci2exp(rec.teta);sci2exp(rec.alpha);
 
1072
        sci2exp(rec.legend);sci2exp(rec.flag(1:2)+1);sci2exp(rec.bbox)]
 
1073
  
 
1074
  txt=[txt;'param3d('+strcat(args,',')+')']
 
1075
endfunction
 
1076
 
 
1077
function %param3d_p(rec)
 
1078
// Copyright INRIA
 
1079
// Author: Serge Steer
 
1080
  
 
1081
  disp(string(rec))
 
1082
endfunction
 
1083
 
 
1084
function txt=%param3d1_string(rec)
 
1085
// Copyright INRIA
 
1086
// Author: Serge Steer
 
1087
  
 
1088
  m=rec.m
 
1089
  txt=[sci2exp(matrix(rec.x,m,-1),'x')
 
1090
       sci2exp(matrix(rec.y,m,-1),'y')]
 
1091
  if rec.iflag==0 then
 
1092
    txt=[txt;sci2exp(matrix(rec.z,m,-1),'z')]
 
1093
  else
 
1094
    txt=[txt;sci2exp(list(matrix(rec.z,m,-1),rec.colors),'z')]
 
1095
  end
 
1096
  args=['x';'y';'z';sci2exp(rec.teta);sci2exp(rec.alpha);
 
1097
        sci2exp(rec.legend);sci2exp(rec.flag(1:2)+1);sci2exp(rec.bbox)]
 
1098
  
 
1099
  txt=[txt;'param3d1('+strcat(args,',')+')']
 
1100
endfunction
 
1101
 
 
1102
function %param3d1_p(rec)
 
1103
// Copyright INRIA
 
1104
// Author: Serge Steer
 
1105
  
 
1106
  disp(string(rec))
 
1107
endfunction
 
1108
 
 
1109
function txt=%contour2_string(rec)
 
1110
// Copyright INRIA
 
1111
// Author: Serge Steer
 
1112
   
 
1113
  if rec.name=='champ' then
 
1114
  n1=rec.n1;
 
1115
  txt=[sci2exp(rec.x,'x')
 
1116
       sci2exp(rec.y,'y')
 
1117
       sci2exp(matrix(rec.fx,n1,-1),'fx')
 
1118
       sci2exp(matrix(rec.fy,n1,-1),'fy')]
 
1119
  args=['x';'y';'fx';'fy';sci2exp(rec.arfact);sci2exp(rec.vrect);sci2exp(rec.strflag)]
 
1120
   txt=[txt;
 
1121
        rec.name+'('+strcat(args,',')+')']
 
1122
  elseif rec.name=='contour2' then
 
1123
    n1=rec.n1;
 
1124
    txt=[sci2exp(rec.x,'x')
 
1125
       sci2exp(rec.y,'y')
 
1126
       sci2exp(matrix(rec.z,n1,-1),'z')]
 
1127
    if rec.flagnz==0 then
 
1128
      nz=sci2exp(rec.nz)
 
1129
    else
 
1130
      nz=sci2exp(rec.zz)
 
1131
    end
 
1132
     args=['x';'y';'z';nz;sci2exp(rec.style);
 
1133
           sci2exp(rec.strflag);sci2exp(rec.legend);sci2exp(rec.brect);
 
1134
           sci2exp(rec.aint)]
 
1135
     txt=[txt;
 
1136
          'contour2d('+strcat(args,',')+')']
 
1137
  else
 
1138
    error('%contour2_string, unknown name: '+rec.name)
 
1139
  end
 
1140
endfunction
 
1141
 
 
1142
function %contour2_p(rec)
 
1143
// Copyright INRIA
 
1144
// Author: Serge Steer
 
1145
  
 
1146
  disp(string(rec))
 
1147
endfunction
 
1148
 
 
1149
function txt=%contour_string(rec)
 
1150
// Copyright INRIA
 
1151
// Author: Serge Steer
 
1152
 
 
1153
   n1=rec.n1;
 
1154
    txt=[sci2exp(rec.x,'x')
 
1155
       sci2exp(rec.y,'y')
 
1156
       sci2exp(matrix(rec.z,n1,-1),'z')]
 
1157
    if rec.flagnz==0 then
 
1158
      nz=sci2exp(rec.nz)
 
1159
    else
 
1160
      nz=sci2exp(rec.zz)
 
1161
    end
 
1162
     args=['x';'y';'z';nz;sci2exp(rec.teta);
 
1163
           sci2exp(rec.alpha);
 
1164
           sci2exp(rec.legend);sci2exp(rec.flag);
 
1165
           sci2exp(rec.bbox);sci2exp(rec.zlev)]
 
1166
     txt=[txt;
 
1167
          'contour('+strcat(args,',')+')']
 
1168
  
 
1169
endfunction
 
1170
 
 
1171
function %contour_p(rec)
 
1172
// Copyright INRIA
 
1173
// Author: Serge Steer
 
1174
  
 
1175
  disp(string(rec))
 
1176
endfunction
 
1177
 
 
1178
function txt=%fec_string(rec)
 
1179
// Copyright INRIA
 
1180
// Author: Serge Steer
 
1181
 
 
1182
  txt=[sci2exp(rec.x,'x')
 
1183
       sci2exp(rec.y,'y')
 
1184
       sci2exp(matrix(rec.triangles,-1,5),'triangles')
 
1185
       sci2exp(rec.func,'func')]
 
1186
  args=['x';'y';'triangles';'func';sci2exp(rec.strflag);
 
1187
        sci2exp(rec.legend);sci2exp(rec.brect);sci2exp(rec.aaint);
 
1188
        sci2exp(rec.zminmax);sci2exp(rec.colminmax)]
 
1189
  txt=[txt;
 
1190
       'fec('+strcat(args,',')+')']
 
1191
endfunction
 
1192
 
 
1193
function %fec_p(rec)
 
1194
// Copyright INRIA
 
1195
// Author: Serge Steer
 
1196
 
 
1197
  disp(string(rec))
 
1198
endfunction
 
1199
 
 
1200
function txt=%gray_string(rec)
 
1201
// Copyright INRIA
 
1202
// Author: Serge Steer
 
1203
  
 
1204
  n2=rec.n2
 
1205
  if rec.name=='gray1' then
 
1206
    txt=sci2exp(matrix(rec.z,-1,n2),'z')
 
1207
    args=['z';sci2exp(rec.strflag);sci2exp(rec.brect);
 
1208
          sci2exp(rec.aint)]
 
1209
    txt=[txt;
 
1210
         'Matplot('+strcat(args,',')+')']
 
1211
  else
 
1212
    txt=[sci2exp(rec.x,'x')
 
1213
         sci2exp(rec.y,'y')
 
1214
         sci2exp(matrix(rec.z,-1,n2),'z')]
 
1215
    args=['x';'y';'z';sci2exp(rec.strflag);sci2exp(rec.brect);
 
1216
          sci2exp(rec.aint)]
 
1217
    txt=[txt;
 
1218
         'grayplot('+strcat(args,',')+')']
 
1219
  end
 
1220
  
 
1221
endfunction
 
1222
 
 
1223
function %gray_p(rec)
 
1224
// Copyright INRIA
 
1225
// Author: Serge Steer
 
1226
  
 
1227
  disp(string(rec))
 
1228
endfunction
 
1229
 
 
1230
function txt=%gray2_string(rec)
 
1231
// Copyright INRIA
 
1232
// Author: Serge Steer
 
1233
 
 
1234
  n2=rec.n2
 
1235
  txt=sci2exp(matrix(rec.z,-1,n2),'z')
 
1236
  args=['z';sci2exp(rec.xrect)]
 
1237
  txt=[txt;
 
1238
       'Matplot1('+strcat(args,',')+')']
 
1239
endfunction
 
1240
 
 
1241
function %gray2_p(rec)
 
1242
// Copyright INRIA
 
1243
// Author: Serge Steer
 
1244
 
 
1245
  disp(string(rec))
 
1246
endfunction
 
1247
function txt=%xgrid_string(rec)
 
1248
// Copyright INRIA
 
1249
// Author: Serge Steer
 
1250
  txt='xgrid('+sci2exp(rec.style)+')'
 
1251
endfunction
 
1252
 
 
1253
function %xgrid_p(rec)
 
1254
// Copyright INRIA
 
1255
// Author: Serge Steer
 
1256
 
 
1257
  disp(string(rec))
 
1258
endfunction