From 146587f6b60046bf487377a7d9482b6704a1ce95 Mon Sep 17 00:00:00 2001 From: eddyem Date: Wed, 29 Aug 2018 17:07:33 +0300 Subject: [PATCH] make gnuplot map circle --- src/netdaemon/plot | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/netdaemon/plot b/src/netdaemon/plot index 5d25454..57d151d 100755 --- a/src/netdaemon/plot +++ b/src/netdaemon/plot @@ -1,23 +1,28 @@ #!/bin/bash +OUT=tmpfile.txt +cat $1 > $OUT +VAL=$(head -n1 $1 | awk '{print $3}') +echo -e "30\t30\t$VAL\n-30\t-30\t$VAL" >> $OUT cat << EOF > gnutplt #!/usr/bin/gnuplot set contour unset surface set cntrparam order 4 set cntrparam bspline -set cntrparam levels auto 6 +#set cntrparam levels auto 6 +#set cntrparam levels incremental -30,0.1,30 set view map set size square -set xrange [-30:30] -set yrange [-30:30] -set dgrid3d 20,20,20 +set xrange [-40:40] +set yrange [-40:40] +set dgrid3d 100,100,4 set table "contour.txt" -splot '$1' u 1:2:3 +splot '$OUT' u 1:2:3 unset table unset contour set surface set table "dgrid.txt" -splot '$1' u 1:2:3 +splot '$OUT' u 1:2:3 unset table reset set terminal canvas enhanced mousing size 1024,768 jsdir 'js' @@ -25,10 +30,13 @@ set output "$1.html" set size square set xrange [-30:30] set yrange [-30:30] +set xlabel "X, dm" +set ylabel "Y, dm" +set title "Mirror temperature" set pm3d map unset key -#set label font ",2" -splot 'dgrid.txt' w pm3d, 'contour.txt' w l lc rgb "black", '$1' u 1:2:3:3 with labels font ",8" +circle(x,y,z) = x**2+y**2 > 900 ? NaN : z +splot 'dgrid.txt' u 1:2:(circle(\$1,\$2,\$3)) w pm3d, 'contour.txt' u 1:2:(circle(\$1,\$2,\$3)) w l lc rgb "black", '$OUT' u 1:2:(circle(\$1,\$2,\$3)):3 with labels font ",8" EOF chmod 755 gnutplt