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
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()
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
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
18
// Author: Serge Steer
21
SciF_version=LoadVectC()
24
typ=LoadVectC();//disp(typ)
25
if typ=='endplots' then break,end
26
rec($+1)=LoadTPlot(typ);
31
function rec=LoadTPlot(typ)
33
// Author: Serge Steer
35
// The table here is translated from routines/graphics/RecLoad.c
36
table=["axis","LoadSciAxis"
38
"colormap","LoadColormap"
39
"contour","LoadContour"
40
"contour2","LoadContour2D"
51
"param3d","LoadParam3D"
52
"param3d1","LoadParam3D1"
55
"plot3d1","LoadPlot3D"
59
k=find(typ==table(:,1))
61
error('LoadTPlot, unknown key '+typ)
63
execstr('rec='+table(k,2)+'()')
67
function rec=LoadXcall1()
69
// Author: Serge Steer
71
// The structure definition is translated from routines/graphics/RecLoad.c
75
rec.string=LoadVectC()
96
if rec.fname=='xstringa' then
104
if fname<>'xcall1' then
105
mseek(pos,ufil,'set')
109
if fname<>'xstringa' then
110
mseek(pos,ufil,'set')
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
122
function rec=LoadEch()
124
// Author: Serge Steer
126
// The structure definition is translated from routines/graphics/RecLoad.c
131
rec.Wrect=LoadVectF()
132
rec.Frect=LoadVectF()
133
rec.Frect_kp=LoadVectF()
136
function rec=LoadNEch()
138
// Author: Serge Steer
140
// The structure definition is translated from routines/graphics/RecLoad.c
146
rec.Wrect=LoadVectF()
147
rec.Frect=LoadVectF()
148
rec.Arect=LoadVectF()
149
rec.Frect_kp=LoadVectF()
151
function rec=LoadColormap()
153
// Author: Serge Steer
155
// The structure definition is translated from routines/graphics/RecLoad.c
159
rec.cmap=matrix(mget(3*nc,'db',ufil),-1,3)
162
function rec=LoadPlot()
164
// Author: Serge Steer
166
// The structure definition is translated from routines/graphics/RecLoad.c
171
rec.name=LoadVectC();
173
if part(rec.xf,1)=='g' then
175
elseif part(rec.xf,1)=='o' then
186
rec.style=LoadVectLI()
187
rec.strflag=LoadVectC()
188
rec.strflag_kp=LoadVectC()
189
rec.legend=LoadVectC()
191
rec.brect=LoadVectF()
192
rec.brect_kp=LoadVectF()
193
rec.aint=LoadVectLI()
194
rec.aint_kp=LoadVectLI()
197
function rec=LoadSciAxis()
199
// Author: Serge Steer
201
// The structure definition is translated from routines/graphics/RecLoad.c
208
rec.fontsize=LoadLI()
209
rec.textcolor=LoadLI()
210
rec.ticscolor=LoadLI()
215
rec.format_n=LoadVectC()
224
rec.logflag=part(typ,3)
227
function rec=LoadGrid()
229
// Author: Serge Steer
231
// The structure definition is translated from routines/graphics/RecLoad.c
238
function rec=LoadParam3D()
240
// Author: Serge Steer
242
// The structure definition is translated from routines/graphics/RecLoad.c
252
rec.legend=LoadVectC()
253
rec.flag=LoadVectLI()
257
function rec=LoadParam3D1()
259
// Author: Serge Steer
261
// The structure definition is translated from routines/graphics/RecLoad.c
268
rec.colors=LoadVectLI()
278
rec.legend=LoadVectC()
279
rec.flag=LoadVectLI()
283
function rec=LoadPlot3D()
285
// Author: Serge Steer
287
// The structure definition is translated from routines/graphics/RecLoad.c
298
rec.legend=LoadVectC()
299
rec.flag=LoadVectLI()
303
function rec=LoadFac3D()
305
// Author: Serge Steer
307
// The structure definition is translated from routines/graphics/RecLoad.c
315
if rec.name=='fac3d2'| rec.name=='fac3d2' then
316
rec.cvect=LoadVectLI()
324
rec.legend=LoadVectC()
325
rec.flag=LoadVectLI()
330
function rec=LoadFec()
332
// Author: Serge Steer
334
// The structure definition is translated from routines/graphics/RecLoad.c
339
rec.name=LoadVectC();
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()];
355
function rec=LoadFec_n()
357
// Author: Serge Steer
359
// The structure definition is translated from routines/graphics/RecLoad.c
364
rec.name=LoadVectC();
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();
380
function rec=LoadContour()
382
// Author: Serge Steer
384
// The structure definition is translated from routines/graphics/RecLoad.c
391
if rec.flagnz<>0 then
403
rec.legend=LoadVectC()
404
rec.flag=LoadVectLI()
408
function rec=LoadContour2D()
410
// Author: Serge Steer
412
// The structure definition is translated from routines/graphics/RecLoad.c
419
if rec.flagnz<>0 then
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()
438
function rec= LoadGray()
440
// Author: Serge Steer
442
// The structure definition is translated from routines/graphics/RecLoad.c
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()
459
function rec= LoadGray1()
461
// Author: Serge Steer
463
// The structure definition is translated from routines/graphics/RecLoad.c
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()
478
function rec= LoadGray2()
480
// Author: Serge Steer
482
// The structure definition is translated from routines/graphics/RecLoad.c
489
rec.xrect=LoadVectF()
491
function rec=LoadChamp()
493
// Author: Serge Steer
495
// The structure definition is translated from routines/graphics/RecLoad.c
506
rec.strflag=LoadVectC()
507
rec.strflag_kp=LoadVectC()
508
rec.vrect=LoadVectF()
509
rec.vrect_kp=LoadVectF()
514
// Author: Serge Steer
516
// Emulate the C procedure in routines/graphics/RecLoad.c
521
function str=LoadVectC()
523
// Author: Serge Steer
525
// Emulate the C procedure in routines/graphics/RecLoad.c
527
n1=mget(1,'uib',ufil)
528
//q=int(n1/4);r=n1-4*q
530
if modulo(n1,4)<>0 then n=4*(int(n1/4)+1),end
532
if n1-1>size(c) then pause,end
536
function x=LoadVectF()
538
// Author: Serge Steer
540
// Emulate the C procedure in routines/graphics/RecLoad.c
546
function i=LoadVectLI()
548
// Author: Serge Steer
550
// Emulate the C procedure in routines/graphics/RecLoad.c
558
// Author: Serge Steer
560
// Emulate the C procedure in routines/graphics/RecLoad.c
567
// Author: Serge Steer
569
// Emulate the C procedure in routines/graphics/RecLoad.c
571
n1=mget(1,'uib',ufil)
573
if modulo(n1,4)<>0 then n=4*(int(n1/4)+1),end
575
if n1-1>size(c) then pause,end
579
function x=LoadVectS()
581
// Author: Serge Steer
583
// Emulate the C procedure in routines/graphics/RecLoad.c
592
function rec=plot2d_rec()
594
// Author: Serge Steer
597
rec=tlist(['plot2d','n1','n2','name','xf','x','y','style','strflag',..
598
'strflag_kp','legend','brect','brect_kp','aint','aint_kp'])
601
function rec=plot3d_rec()
603
// Author: Serge Steer
605
rec=tlist(['plot3d','p','q','teta','alpha','name','x','y','z',..
606
'legend','flag','bbox'])
609
function rec= xcall1_rec()
611
// Author: Serge Steer
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'])
617
function rec= xtitle_rec()
619
// Author: Serge Steer
620
rec=tlist(['xtitle','strs'])
623
function rec=scale_rec()
625
// Author: Serge Steer
627
rec=tlist(['scale','logflag','name','Wrect','Frect','Frect_kp'])
630
function rec=nscale_rec()
632
// Author: Serge Steer
634
rec=tlist(['nscale','logflag','name','flag','Wrect','Frect','Arect','Frect_kp'])
637
function rec=sciaxis_rec()
639
// Author: Serge Steer
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'])
646
function rec=xgrid_rec()
648
// Author: Serge Steer
650
rec=tlist(['xgrid','style','name'])
652
function rec=param3d_rec()
654
// Author: Serge Steer
656
rec=tlist(['param3d','n','teta' 'alpha' 'name',..
657
'x' 'y' 'z' 'legend' 'flag','bbox'])
660
function rec=param3d1_rec()
662
// Author: Serge Steer
664
rec=tlist(['param3d1','m','n','iflag','colors','teta' 'alpha' 'name',..
665
'x' 'y' 'z' 'legend' 'flag' 'bbox'])
668
function rec=fac3d_rec()
670
// Author: Serge Steer
672
rec=tlist(['fac3d','p','q','teta','alpha','name','cvect','x','y','z',..
673
'legend','flag','bbox'])
676
function rec=fec_rec()
678
// Author: Serge Steer
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'])
685
function rec=colormap_rec()
687
// Author: Serge Steer
689
rec=tlist(['colormap','cmap'])
692
function rec=contour_rec()
694
// Author: Serge Steer
696
rec=tlist(['contour','n1','n2','nz','flagnz','zz','teta','alpha','zlev',..
697
'name','x','y','z','legend','flag','bbox'])
700
function rec=contour2d_rec()
702
// Author: Serge Steer
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'])
709
function rec=gray_rec()
711
// Author: Serge Steer
713
rec=tlist(['gray','n1','n2','name','x','y','z','style',..
714
'strflag','strflag_kp','legend','brect',..
715
'brect_kp','aint','aint_kp'])
718
function rec=gray_rec_2()
720
// Author: Serge Steer
722
rec=tlist(['gray2','n1','n2','name','z','xrect'])
725
function rec=champ_rec()
727
// Author: Serge Steer
729
rec=tlist(['contour2d','n1','n2','arfact',..
730
'name','x','y','fx','fy','strflag','strflag_kp','vrect',..
734
function txt=%xcall1_string(rec)
736
// Author: Serge Steer
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",..
745
txt=txt+','+string(rec.x1)+')'
746
elseif or(rec.string==["default","wshow","wwpc","clipoff"]) then
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
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)+')'
768
txt=[sci2exp(matrix(rec.dx1,-1,4),'x')
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)+')'
777
txt=[sci2exp(matrix(rec.dx1,m,-1),'x')
778
sci2exp(matrix(rec.dx2,m,-1),'y')
779
'xpolys(x,y,'+dr+')']
781
txt='xstring('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
782
sci2exp(rec.string,0)+','+sci2exp(rec.dx3,0)+')'
784
txt='xstringb('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+','+..
785
sci2exp(rec.string,0)+','+sci2exp(rec.dx3,0)+','+sci2exp(rec.dx4,0)+')'
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+')']
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)+')'
801
txt=[sci2exp(matrix(rec.dx1,6,-1),'arcs',0)
802
'xarcs(arcs,'+sci2exp(rec.x2,0)+')']
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)+')'
808
txt=[sci2exp(matrix(rec.dx1,6,-1),'arcs',0)
809
'xfarcs(arcs,'+sci2exp(rec.x2,0)+')']
811
txt=['xaxis('+sci2exp(rec.dx1,0)+','+sci2exp(rec.x2,0)+','+..
812
sci2exp(rec.dx2,0)+','+sci2exp(rec.dx3,0)+')']
814
txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
815
',''lines'','+sci2exp(rec.x4,0)+')']
817
txt=['xfpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
818
','+sci2exp(rec.x4,0)+')']
822
txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
823
',''lines'','+sci2exp(rec.x4,0)+')']
826
txt=['xpoly('+sci2exp(rec.dx1,0)+','+sci2exp(rec.dx2,0)+..
827
',''marks'','+sci2exp(rec.x4,0)+')']
829
error('%xcall1_string, unknown keyword: '+rec.fname)
833
function %xcall1_p(rec)
835
// Author: Serge Steer
840
function txt=%xtitle_string(rec)
842
// Author: Serge Steer
843
txt='xtitle('+sci2exp(rec.strs(1))+','+sci2exp(rec.strs(2))+','+..
844
sci2exp(rec.strs(3))+')'
847
function %xtitle_p(rec)
849
// Author: Serge Steer
850
disp(%xtitle_string(rec))
854
function txt=%plot2d_string(rec)
856
// Author: Serge Steer
862
rec.x=matrix(rec.x,n2,-1)
863
txt=[txt;sci2exp(rec.x,'x')];txt($)=txt($)+';';x='x';
865
rec.y=matrix(rec.y,n2,-1)
866
txt=[txt;sci2exp(rec.y,'y')];txt($)=txt($)+';';y='y';
868
txt=[txt;rec.name+'(""'+rec.xf+'"",'+x+','+y+','+sci2exp(rec.style)+',""'+..
869
rec.strflag+'"",""'+rec.legend+'"",'+sci2exp(rec.brect)+','+..
870
sci2exp(rec.aint)+')']
873
function %plot2d_p(rec)
875
// Author: Serge Steer
880
function txt=%plot3d_string(rec)
882
// Author: Serge Steer
889
if size(rec.x,'*')<>p then rec.x=matrix(rec.x,p,q),end
890
txt=[txt;sci2exp(rec.x,'x')]
893
if size(rec.y,'*')<>p then rec.y=matrix(rec.y,p,q),end
894
txt=[txt;sci2exp(rec.y,'y')]
898
txt=[txt;sci2exp(matrix(rec.z,p,q),'z')]
902
txt=[txt;rec.name+'('+x+','+y+','+z+','+sci2exp(rec.teta)+','+..
903
sci2exp(rec.alpha)+',""'+rec.legend+'"",'+sci2exp(rec.flag)+','+..
904
sci2exp(rec.bbox)+')']
907
function %plot3d_p(rec)
909
// Author: Serge Steer
914
function txt=%fac3d_string(rec)
916
// Author: Serge Steer
923
rec.x=matrix(rec.x,p,q)
924
txt=[txt;sci2exp(rec.x,'x')]
927
rec.y=matrix(rec.y,p,q)
928
txt=[txt;sci2exp(rec.y,'y')]
931
txt=[txt;sci2exp(matrix(rec.z,p,q),'x')]
934
txt=[txt;rec.name+'('+x+','+y+','+z+','+sci2exp(rec.teta)+','+..
935
sci2exp(rec.alpha)+'""'+rec.legend+'"",'+sci2exp(rec.flag)+','+..
936
sci2exp(rec.bbox)+')']
939
function %fac3d_p(rec)
941
// Author: Serge Steer
948
function %SPLOT_p(rec)
950
// Author: Serge Steer
956
function txt=%SPLOT_string(rec)
958
// Author: Serge Steer
961
txt=[txt;string(rec(k))]
965
function txt=%nscale_string(rec)
967
// Author: Serge Steer
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],',')+')'
978
function %nscale_p(rec)
980
// Author: Serge Steer
985
function txt=%scale_string(rec)
987
// Author: Serge Steer
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],',')+')'
997
function %scale_p(rec)
999
// Author: Serge Steer
1005
function txt=%colormap_string(rec)
1007
// Author: Serge Steer
1009
txt=[sci2exp(rec.cmap,'cmap')
1010
'xset('"colormap'",cmap)']
1013
function %colormap_p(rec)
1015
// Author: Serge Steer
1020
function txt=%sciaxis_string(rec)
1022
// Author: Serge Steer
1024
f=['x';'y';'dir';'sub_int';'tics']
1028
if size(rec(f(k)),'*')==1 then
1029
args=[args sci2exp(rec(f(k)),f(k))]
1031
txt=[txt;sci2exp(rec(f(k)),f(k))]
1032
args=[args f(k)+'='+f(k)]
1036
args=[args sci2exp(rec.seg,'seg')],
1038
if length(rec.format_n)>0 then
1039
args=[args sci2exp(rec.format_n,'format_n')]
1041
if rec.textcolor<>-1 then
1042
args=[args sci2exp(rec.textcolor,'textcolor')],
1044
if rec.ticscolor<>-1 then
1045
args=[args sci2exp(rec.ticscolor,'ticscolor')],
1047
if rec.fontsize<>-1 then
1048
args=[args sci2exp(rec.fontsize,'fontsize')],
1052
txt=[txt;'drawaxis('+strcat(args,',')+')']
1056
function %sciaxis_p(rec)
1058
// Author: Serge Steer
1063
function txt=%param3d_string(rec)
1065
// Author: Serge Steer
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)]
1074
txt=[txt;'param3d('+strcat(args,',')+')']
1077
function %param3d_p(rec)
1079
// Author: Serge Steer
1084
function txt=%param3d1_string(rec)
1086
// Author: Serge Steer
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')]
1094
txt=[txt;sci2exp(list(matrix(rec.z,m,-1),rec.colors),'z')]
1096
args=['x';'y';'z';sci2exp(rec.teta);sci2exp(rec.alpha);
1097
sci2exp(rec.legend);sci2exp(rec.flag(1:2)+1);sci2exp(rec.bbox)]
1099
txt=[txt;'param3d1('+strcat(args,',')+')']
1102
function %param3d1_p(rec)
1104
// Author: Serge Steer
1109
function txt=%contour2_string(rec)
1111
// Author: Serge Steer
1113
if rec.name=='champ' then
1115
txt=[sci2exp(rec.x,'x')
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)]
1121
rec.name+'('+strcat(args,',')+')']
1122
elseif rec.name=='contour2' then
1124
txt=[sci2exp(rec.x,'x')
1126
sci2exp(matrix(rec.z,n1,-1),'z')]
1127
if rec.flagnz==0 then
1132
args=['x';'y';'z';nz;sci2exp(rec.style);
1133
sci2exp(rec.strflag);sci2exp(rec.legend);sci2exp(rec.brect);
1136
'contour2d('+strcat(args,',')+')']
1138
error('%contour2_string, unknown name: '+rec.name)
1142
function %contour2_p(rec)
1144
// Author: Serge Steer
1149
function txt=%contour_string(rec)
1151
// Author: Serge Steer
1154
txt=[sci2exp(rec.x,'x')
1156
sci2exp(matrix(rec.z,n1,-1),'z')]
1157
if rec.flagnz==0 then
1162
args=['x';'y';'z';nz;sci2exp(rec.teta);
1164
sci2exp(rec.legend);sci2exp(rec.flag);
1165
sci2exp(rec.bbox);sci2exp(rec.zlev)]
1167
'contour('+strcat(args,',')+')']
1171
function %contour_p(rec)
1173
// Author: Serge Steer
1178
function txt=%fec_string(rec)
1180
// Author: Serge Steer
1182
txt=[sci2exp(rec.x,'x')
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)]
1190
'fec('+strcat(args,',')+')']
1193
function %fec_p(rec)
1195
// Author: Serge Steer
1200
function txt=%gray_string(rec)
1202
// Author: Serge Steer
1205
if rec.name=='gray1' then
1206
txt=sci2exp(matrix(rec.z,-1,n2),'z')
1207
args=['z';sci2exp(rec.strflag);sci2exp(rec.brect);
1210
'Matplot('+strcat(args,',')+')']
1212
txt=[sci2exp(rec.x,'x')
1214
sci2exp(matrix(rec.z,-1,n2),'z')]
1215
args=['x';'y';'z';sci2exp(rec.strflag);sci2exp(rec.brect);
1218
'grayplot('+strcat(args,',')+')']
1223
function %gray_p(rec)
1225
// Author: Serge Steer
1230
function txt=%gray2_string(rec)
1232
// Author: Serge Steer
1235
txt=sci2exp(matrix(rec.z,-1,n2),'z')
1236
args=['z';sci2exp(rec.xrect)]
1238
'Matplot1('+strcat(args,',')+')']
1241
function %gray2_p(rec)
1243
// Author: Serge Steer
1247
function txt=%xgrid_string(rec)
1249
// Author: Serge Steer
1250
txt='xgrid('+sci2exp(rec.style)+')'
1253
function %xgrid_p(rec)
1255
// Author: Serge Steer