]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.gnuplot/test/org/simantics/gnuplot/tests/hexagons.plt
Added missing plug-ins from old SVN repository trunk
[simantics/platform.git] / bundles / org.simantics.gnuplot / test / org / simantics / gnuplot / tests / hexagons.plt
1 reset\r
2 fn = 'hexagons.dat'\r
3 S = 0.5\r
4 C = sqrt(3)/2\r
5 A = 1/C\r
6 a = 0.95*A\r
7 \r
8 hex_id = 1\r
9 \r
10 cmd = ''\r
11 \r
12 hex_cmd(x, y, c) = sprintf("set obj hex_id poly from %g,%g-a to %g+a*C, %g-a*S to %g+a*C,%g+a*S to %g,%g+a to %g-a*C,%g+a*S to %g-a*C,%g-a*S to %g,%g-a fs solid 0.8 border lc pal cb %g lw 2 fc pal cb %g; hex_id = hex_id + 1;", x,y,x,y,x,y,x,y,x,y,x,y,x,y,c,c)\r
13 \r
14 read_f(x, y, c) = (cmd=cmd.hex_cmd(x, y, c), y)\r
15 \r
16 set term unknown\r
17 \r
18 plot fn using 1:(read_f($1,$2,$3))\r
19 \r
20 set term pop\r
21 \r
22 print cmd\r
23 eval cmd\r
24 \r
25 set size ratio -1\r
26 set xr [GPVAL_X_MIN-A:GPVAL_X_MAX+A]\r
27 set yr [GPVAL_Y_MIN-A:GPVAL_Y_MAX+A]\r
28 \r
29 set term svg\r
30 #plot fn using 1:2:3 w d lc pal notit\r
31 plot fn using 1:2:3 notitle lc pal w d\r