summaryrefslogtreecommitdiff
path: root/texmf-dist/scripts/ketpic/ketlib/ketpicscifiles6/Vtickmark.sci
blob: de32091885f91afd574e3e1ab4f457279e0cf774 (plain)
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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// 08.05.26 Debugged
// 09.12.25
// 11.04.13 debugged ( [a,b] )
// 14.03.05 MARKLEN

function Vtickmark(varargin)
  global Wfile FID MARKLEN GENTEN YMIN YMAX;
  Nargs=length(varargin);
  ArgsL=list(varargin(1:Nargs));
  if type(Op(1,ArgsL))==10
    Str=Op(1,ArgsL);
    Tmp=mtlb_findstr(Str,'m');
    if Tmp~=[]
      I=Tmp(1);
    else
      I=0;
    end
    Tmp=mtlb_findstr(Str,'n');
    if Tmp~=[]
      J=Tmp(1);
    else
      J=0;
    end
    Tmp=mtlb_findstr(Str,'r');
    if Tmp~=[]
      K=Tmp(1);
    else
      K=0;
    end;
    if K>0
      Tmp=ascii(Str);
      S=char(Tmp(K+1:length(Tmp)));
      R=msscanf(S,'%f');
      if length(R)==0
        R=1;
      end
    else
      R=1;
      K=length(Str)+1;
    end
    if J>0 then
      Tmp=ascii(Str);
      S=char(Tmp(J+1:K-1));
      if S==[]
        S='';
      end;
      Dn=msscanf(S,'%d');
      if length(Dn)==0
        Dn=1;
      end
    else
      Dn=1000;
      J=length(Str)+1;
    end
    Tmp=ascii(Str);
    S=char(Tmp(I+1:J-1));
    if S==[]
      S='';
    end
    Dm=msscanf(S,'%f');
    if length(Dm)==0
      Dm=1;
    end
    ArgsL=list();
    for I=1:floor((YMAX-GENTEN(2))/Dm)
      ArgsL($+1)=I*Dm;
      if I-floor(I/Dn)*Dn==0
        Str=string(I*Dm*R);
        K=length(Str);
        Tmp=ascii(Str);
        if char(Tmp(K))=='.'
          Str=char(Tmp(1:k-1));
        end
        ArgsL($+1)=Str;
      end
    end
    for I=-1:-1:ceil((YMIN-GENTEN(2))/Dm)
      ArgsL($+1)=I*Dm;
      if I-floor(I/Dn)*Dn==0
        Str=string(I*Dm*R);
        K=length(Str);
        Tmp=ascii(Str);
        if char(Tmp(K))=='.'
          Str=char(1:K-1);
        end
        ArgsL($+1)=Str;
      end
    end
  end
  MemoriList=list();
  Memori=list();
  for N=1:length(ArgsL)
    Dt=Op(N,ArgsL);
    if type(Dt)==1 & length(Dt)>1
      if length(Memori)>0
        MemoriList($+1)=Memori;
      end
      Memori=list(Dt(1),Dt(2));
      continue
    end
    if type(Dt)==10
      Memori($+1)=Dt;
    else
      if length(Memori)>0
        MemoriList($+1)=Memori;
      end
      Memori=list(GENTEN(1),Dt);
    end
  end
  MemoriList($+1)=Memori;
  for N=1:length(MemoriList)
    Dt=MemoriList(N);
    Ndt=length(Dt);
    X=Op(1,Dt);
    Y=Op(2,Dt);
    Tmp=Doscaling([X,Y]);
    X=Tmp(1);
    Y=Tmp(2);
    Moji=Op(Ndt,Dt);
    Tmp1=Unscaling([X+MARKLEN,Y]);
    Tmp2=Unscaling([X-MARKLEN,Y]);
    Fd=Listplot([Tmp1,Tmp2]);    
    Drwline(Fd);
    if Ndt==3
      Tmp=Unscaling([X-MARKLEN,Y]);
      Expr(Tmp,'w',Moji);
    end
    if Ndt==4
      Houkou=Op(3,Dt);
      if mtlb_findstr(Houkou,'w')~=[]
        Tmp=Unscaling([X-MARKLEN,Y]);
        Expr(Tmp,Houkou,Moji);
      else
        Tmp=Unscaling([X+MARKLEN,Y]);
        Expr(Tmp,Houkou,Moji);
      end
    end
    if Wfile=='default'
      mprintf('%s\n','%');
    else
      mfprintf(FID,'%s\n','%');
    end
  end
endfunction;