]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.gnuplot/test/org/simantics/gnuplot/tests/hexagons.plt b/bundles/org.simantics.gnuplot/test/org/simantics/gnuplot/tests/hexagons.plt
new file mode 100644 (file)
index 0000000..8b5aca1
--- /dev/null
@@ -0,0 +1,31 @@
+reset\r
+fn = 'hexagons.dat'\r
+S = 0.5\r
+C = sqrt(3)/2\r
+A = 1/C\r
+a = 0.95*A\r
+\r
+hex_id = 1\r
+\r
+cmd = ''\r
+\r
+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
+\r
+read_f(x, y, c) = (cmd=cmd.hex_cmd(x, y, c), y)\r
+\r
+set term unknown\r
+\r
+plot fn using 1:(read_f($1,$2,$3))\r
+\r
+set term pop\r
+\r
+print cmd\r
+eval cmd\r
+\r
+set size ratio -1\r
+set xr [GPVAL_X_MIN-A:GPVAL_X_MAX+A]\r
+set yr [GPVAL_Y_MIN-A:GPVAL_Y_MAX+A]\r
+\r
+set term svg\r
+#plot fn using 1:2:3 w d lc pal notit\r
+plot fn using 1:2:3 notitle lc pal w d\r