Rev 20 | Rev 4162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 20 | Rev 2100 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | 1,x_step (delta x for 1 cm on the paper or max value for x and optional label ) \ |
10 | 1,x_step (delta x for 1 cm on the paper or max value for x and optional label ) \ |
11 | 1,y_step (delta y for 1 cm on the paper or max value for y and optional label) \ |
11 | 1,y_step (delta y for 1 cm on the paper or max value for y and optional label) \ |
12 | [240,233,255],background color \ |
12 | [240,233,255],background color \ |
13 | [255,220,180],lines color \ |
13 | [255,220,180],lines color \ |
14 | [10,10,10],dots color \ |
14 | [10,10,10],dots color \ |
15 |
|
15 | void, <ol><li>optional list of style specifications. The syntax of style specifications is : <ul><li><span style="color:green;">style:grad={xy, no, x_only, y_only}</span> for graduations [defaults to xy], to draw respectively both graduations, no graduations, graduations only on x axis, graduations only on y axis ;<li><span style="color:green;">style:dot={+,x,o}</span> for dots [defaults to +], to make dots like straight crosses, oblique crosses, circles. </ul><li>Then optional list of dots (an even count of coordinates : x1,y1,x2,y2,etc.)</ul> |
16 | slib_author=Georges KHAZNADAR |
16 | slib_author=Georges KHAZNADAR |
17 | slib_out=Source for insdraw-ing a graph paper with the dots on it |
17 | slib_out=Source for insdraw-ing a graph paper with the dots on it |
18 | slib_comment=if color are three numbers, \ |
18 | slib_comment=if color are three numbers, \ |
19 | put them in brackets ; there may be no dots.<br> \ |
19 | put them in brackets ; there may be no dots.<br><br> \ |
20 | The syntax for x_step and y_step is the following |
20 | The syntax for <b>x_step</b> and <b>y_step</b> is the following : \ |
21 | a bare number is for deltaX or deltaY, a number followed by the \ |
21 | a bare number is for deltaX or deltaY, a number followed by the \ |
22 | word "max" means a maximum value, any other words are interpreted \ |
22 | word "max" means a maximum value, any other words are interpreted \ |
23 | like a label for the axis. |
23 | like a label for the axis. |
24 | slib_example= ,,,,,,,,,0,0,1.2,1.5,2.4,3.2\ |
24 | slib_example= ,,,,,,,,,0,0,1.2,1.5,2.4,3.2\ |
25 | 12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],0,0,1.2,1.5,2.4,3. |
25 | 12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],0,0,1.2,1.5,2.4,3.2\ |
- | 26 | 12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],style.grad=x_only, style.dot=o,0,0,1.2,1.5,2.4,3.2 |
|
26 | 27 | ||
27 | 28 | ||
28 | !exit |
29 | !exit |
29 | 30 | ||
30 | :proc |
31 | :proc |
31 | 32 | ||
32 | !reset |
33 | !reset slib_formdot,slib_grad,slib_xd, slib_yd, slib_bg, slib_lc, slib_dc, slib_point, slib_xo, slib_yo, slib_xs, slib_ys, slib_labx, slib_laby, slib_maxx, slib_maxy, slib_style, slib_empty, slib_key, slib_val, slib_pos |
33 | 34 | ||
34 | slib_parm=!item 1 to 9 of $wims_read_parm |
35 | slib_parm=!item 1 to 9 of $wims_read_parm |
35 | !distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_bg, slib_lc, slib_dc |
36 | !distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_bg, slib_lc, slib_dc |
36 | 37 | ||
37 | slib_point=!item 10 to -1 of $wims_read_parm |
38 | slib_point=!item 10 to -1 of $wims_read_parm |
- | 39 | ||
- | 40 | slib_empty= |
|
- | 41 | slib_style=!item 1 of $slib_point |
|
- | 42 | slib_pos=!positionof style: in $slib_style |
|
- | 43 | !while $slib_pos=0 |
|
- | 44 | slib_point=!item 2 to -1 of $slib_point |
|
- | 45 | slib_style= !replace style: by $slib_empty in $slib_style |
|
- | 46 | slib_style= !replace = by , in $slib_style |
|
- | 47 | !distribute item $slib_style into slib_key, slib_val |
|
- | 48 | !if $slib_key=grad |
|
- | 49 | !if $slib_val=no |
|
- | 50 | slib_grad=0 |
|
- | 51 | !endif |
|
- | 52 | !if $slib_val=x_only |
|
- | 53 | slib_grad=2 |
|
- | 54 | !endif |
|
- | 55 | !if $slib_val=y_only |
|
- | 56 | slib_grad=3 |
|
- | 57 | !endif |
|
- | 58 | !endif |
|
- | 59 | !if $slib_key=dot |
|
- | 60 | !if $slib_val=x |
|
- | 61 | slib_formdot=0 |
|
- | 62 | !endif |
|
- | 63 | !if $slib_val=o |
|
- | 64 | slib_formdot=2 |
|
- | 65 | !endif |
|
- | 66 | !endif |
|
- | 67 | slib_style=!item 1 of $slib_point |
|
- | 68 | slib_pos=!positionof style: in $slib_style |
|
- | 69 | !endwhile |
|
38 | 70 | ||
39 | !default slib_xd=8 |
71 | !default slib_xd=8 |
40 | !default slib_yd=8 |
72 | !default slib_yd=8 |
41 | !default slib_xo=1 |
73 | !default slib_xo=1 |
42 | !default slib_yo=1 |
74 | !default slib_yo=1 |
43 | !default slib_xs=1 |
75 | !default slib_xs=1 |
44 | !default slib_ys=1 |
76 | !default slib_ys=1 |
- | 77 | !default slib_grad=1 |
|
- | 78 | !default slib_formdot=1 |
|
45 | 79 | ||
46 | slib_labx=!word 2 to -1 of $slib_xs |
80 | slib_labx=!word 2 to -1 of $slib_xs |
47 | slib_laby=!word 2 to -1 of $slib_ys |
81 | slib_laby=!word 2 to -1 of $slib_ys |
48 | slib_xs=!word 1 of $slib_xs |
82 | slib_xs=!word 1 of $slib_xs |
49 | slib_ys=!word 1 of $slib_ys |
83 | slib_ys=!word 1 of $slib_ys |
Line 141... | Line 175... | ||
141 | parallel 0,$[10*$slib_yo+1],0,$[10*$slib_yo-1], 10, 0, $slib_xd+1, $slib_grey |
175 | parallel 0,$[10*$slib_yo+1],0,$[10*$slib_yo-1], 10, 0, $slib_xd+1, $slib_grey |
142 | 176 | ||
143 | slib_val=$[-$slib_xo*$slib_xs] |
177 | slib_val=$[-$slib_xo*$slib_xs] |
144 | slib_dessin=$slib_dessin\ |
178 | slib_dessin=$slib_dessin\ |
145 | linewidth 1 |
179 | linewidth 1 |
- | 180 | !if ($slib_grad=2 or $slib_grad=1) |
|
146 | !for slib_x from 0 to 10*$slib_xd step 10 |
181 | !for slib_x from 0 to 10*$slib_xd step 10 |
147 | slib_dessin=$slib_dessin\ |
182 | slib_dessin=$slib_dessin\ |
148 | text blue,$[$slib_x+1],$[10*$slib_yo-1],medium,$slib_val |
183 | text blue,$[$slib_x+1],$[10*$slib_yo-1],medium,$slib_val |
149 | slib_val=$[$slib_val+$slib_xs] |
184 | slib_val=$[$slib_val+$slib_xs] |
150 | !next slib_x |
185 | !next slib_x |
151 | !if $slib_labx != $empty |
186 | !if $slib_labx != $empty |
152 | slib_dessin=$slib_dessin\ |
187 | slib_dessin=$slib_dessin\ |
153 | text blue,$[$slib_x-20],$[10*$slib_yo-6],medium,$slib_labx |
188 | text blue,$[$slib_x-20],$[10*$slib_yo-6],medium,$slib_labx |
154 | !endif |
189 | !endif |
155 | 190 | !endif |
|
156 | 191 | ||
157 | !! axe_y |
192 | !! axe_y |
158 | slib_dessin=$slib_dessin\ |
193 | slib_dessin=$slib_dessin\ |
159 | linewidth 3\ |
194 | linewidth 3\ |
160 | vline $[10*$slib_xo],0, $slib_grey\ |
195 | vline $[10*$slib_xo],0, $slib_grey\ |
161 | line $[10*$slib_xo-1],$[10*$slib_yd-3],$[10*$slib_xo],$[10*$slib_yd-1], $slib_grey\ |
196 | line $[10*$slib_xo-1],$[10*$slib_yd-3],$[10*$slib_xo],$[10*$slib_yd-1], $slib_grey\ |
162 | line $[10*$slib_xo+1],$[10*$slib_yd-3],$[10*$slib_xo],$[10*$slib_yd-1], $slib_grey\ |
197 | line $[10*$slib_xo+1],$[10*$slib_yd-3],$[10*$slib_xo],$[10*$slib_yd-1], $slib_grey\ |
163 | parallel $[10*$slib_xo+1],0,$[10*$slib_xo-1], 0, 0, 10, $slib_yd+1, $slib_grey |
198 | parallel $[10*$slib_xo+1],0,$[10*$slib_xo-1], 0, 0, 10, $slib_yd+1, $slib_grey |
164 | 199 | ||
165 | slib_val=$[-$slib_yo*$slib_ys] |
200 | slib_val=$[-$slib_yo*$slib_ys] |
166 | slib_dessin=$slib_dessin\ |
201 | slib_dessin=$slib_dessin\ |
167 | linewidth 1 |
202 | linewidth 1 |
- | 203 | !if ($slib_grad=3 or $slib_grad=1) |
|
168 | !for slib_y from 0 to 10*$slib_yd step 10 |
204 | !for slib_y from 0 to 10*$slib_yd step 10 |
169 | slib_dessin=$slib_dessin\ |
205 | slib_dessin=$slib_dessin\ |
170 | text blue,$[10*$slib_xo+1],$[$slib_y-1],medium,$slib_val |
206 | text blue,$[10*$slib_xo+1],$[$slib_y-1],medium,$slib_val |
171 | slib_val=$[$slib_val+$slib_ys] |
207 | slib_val=$[$slib_val+$slib_ys] |
172 | !next slib_y |
208 | !next slib_y |
173 | !if $slib_laby != $empty |
209 | !if $slib_laby != $empty |
174 | slib_dessin=$slib_dessin\ |
210 | slib_dessin=$slib_dessin\ |
175 | text blue,$[10*$slib_xo-9],$[$slib_y-10],medium,$slib_laby |
211 | text blue,$[10*$slib_xo-9],$[$slib_y-10],medium,$slib_laby |
- | 212 | !endif |
|
176 | !endif |
213 | !endif |
177 | 214 | ||
178 | !!!!!!!!!!!!!!!!! end grid !!!!!!!!!!!!!!!!!!!!!!!!! |
215 | !!!!!!!!!!!!!!!!! end grid !!!!!!!!!!!!!!!!!!!!!!!!! |
179 | 216 | ||
180 | slib_i=0 |
217 | slib_i=0 |
Line 185... | Line 222... | ||
185 | !goto continue |
222 | !goto continue |
186 | !endif |
223 | !endif |
187 | !if $slib_i=1 |
224 | !if $slib_i=1 |
188 | slib_i=0 |
225 | slib_i=0 |
189 | slib_y=$[10*$slib_xy/$slib_ys] |
226 | slib_y=$[10*$slib_xy/$slib_ys] |
- | 227 | !if $slib_formdot=0 |
|
190 | slib_x1=$[10*$slib_xo+$slib_x-0.6] |
228 | slib_x1=$[10*$slib_xo+$slib_x-0.6] |
191 | slib_x2=$[10*$slib_xo+$slib_x+0.6] |
229 | slib_x2=$[10*$slib_xo+$slib_x+0.6] |
192 | slib_y1=$[10*$slib_yo+$slib_y-0.6] |
230 | slib_y1=$[10*$slib_yo+$slib_y-0.6] |
193 | slib_y2=$[10*$slib_yo+$slib_y+0.6] |
231 | slib_y2=$[10*$slib_yo+$slib_y+0.6] |
194 | slib_dessin=$slib_dessin\ |
232 | slib_dessin=$slib_dessin\ |
195 | linewidth 2\ |
233 | linewidth 2\ |
196 | line $slib_x1,$slib_y1,$slib_x2,$slib_y2,$slib_dc\ |
234 | line $slib_x1,$slib_y1,$slib_x2,$slib_y2,$slib_dc\ |
197 | line $slib_x2,$slib_y1,$slib_x1,$slib_y2,$slib_dc |
235 | line $slib_x2,$slib_y1,$slib_x1,$slib_y2,$slib_dc |
- | 236 | !endif |
|
- | 237 | !if $slib_formdot=1 |
|
- | 238 | slib_x1=$[10*$slib_xo+$slib_x-1] |
|
- | 239 | slib_x2=$[10*$slib_xo+$slib_x+1] |
|
- | 240 | slib_x3=$[10*$slib_xo+$slib_x] |
|
- | 241 | slib_y1=$[10*$slib_yo+$slib_y] |
|
- | 242 | slib_y2=$[10*$slib_yo+$slib_y+1] |
|
- | 243 | slib_y3=$[10*$slib_yo+$slib_y-1] |
|
- | 244 | slib_dessin=$slib_dessin\ |
|
- | 245 | linewidth 2\ |
|
- | 246 | line $slib_x1,$slib_y1,$slib_x2,$slib_y1,$slib_dc\ |
|
- | 247 | line $slib_x3,$slib_y2,$slib_x3,$slib_y3,$slib_dc |
|
- | 248 | !endif |
|
- | 249 | !if $slib_formdot=2 |
|
- | 250 | slib_dessin=$slib_dessin\ |
|
- | 251 | linewidth 1\ |
|
- | 252 | circle $slib_xo+$slib_x,$slib_yo+$slib_y,6,$slib_dc |
|
- | 253 | !endif |
|
198 | !endif |
254 | !endif |
199 | :continue |
255 | :continue |
200 | !next slib_xy |
256 | !next slib_xy |
201 | 257 | ||
202 | slib_out= $slib_dessin |
258 | slib_out= $slib_dessin |