From 7bc29b9e3d75bd90481e6651fec4e45663d7ecdb Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 30 Jan 2024 14:52:25 +0100 Subject: [PATCH] Savepoint plotting --- scratchpad/plotting/gnuplot/term1.gp | 2 ++ scratchpad/plotting/gnuplot/term1b.gp | 21 ++++++++++++++++ scratchpad/plotting/gnuplot/term3.gp | 36 +++++++++++++-------------- scratchpad/plotting/gnuplot/term4.gp | 26 +++++++++++++++++++ 4 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 scratchpad/plotting/gnuplot/term1b.gp create mode 100644 scratchpad/plotting/gnuplot/term4.gp diff --git a/scratchpad/plotting/gnuplot/term1.gp b/scratchpad/plotting/gnuplot/term1.gp index 5bb246e..cda2b31 100644 --- a/scratchpad/plotting/gnuplot/term1.gp +++ b/scratchpad/plotting/gnuplot/term1.gp @@ -1,5 +1,7 @@ reset set terminal dumb size 80, 25 +max=3 +min=-3 n=100 #number of intervals width=(max-min)/n #interval width #function used to map a value to the intervals diff --git a/scratchpad/plotting/gnuplot/term1b.gp b/scratchpad/plotting/gnuplot/term1b.gp new file mode 100644 index 0000000..28e5f10 --- /dev/null +++ b/scratchpad/plotting/gnuplot/term1b.gp @@ -0,0 +1,21 @@ +reset +set terminal dumb size 80, 25 +n=100 #number of intervals +max=5. #max value +min=-5. #min value +width=(max-min)/n #interval width +#function used to map a value to the intervals +hist(x,width)=width*floor(x/width)+width/2.0 +set xrange [min:max] +set yrange [0:] +#to put an empty boundary around the +#data inside an autoscaled graph. +set offset graph 0.05,0.05,0.05,0.0 +set xtics min,(max-min)/5,max +set boxwidth width*0.9 +set style fill solid 0.5 #fillstyle +set tics out nomirror +set xlabel "x" +set ylabel "Frequency" +#count and plot +plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle diff --git a/scratchpad/plotting/gnuplot/term3.gp b/scratchpad/plotting/gnuplot/term3.gp index 8e5885f..b527d81 100644 --- a/scratchpad/plotting/gnuplot/term3.gp +++ b/scratchpad/plotting/gnuplot/term3.gp @@ -1,26 +1,26 @@ reset -stats 'data.dat' +stats 'data.dat' nooutput # show variables all -# STATS_min -# STATS_max +max=STATS_max +min=STATS_min -set terminal dumb size 100, 25 -n=1000 #number of intervals -max=STATS_max #max value -min=STATS_min #min value -width=(max-min)/n #interval width +n=1000 +width=(max-min)/n hist(x,width)=width*floor(x/width)+width/2.0 + set xrange [min:max] set yrange [0:] -#to put an empty boundary around the -#data inside an autoscaled graph. -# set offset graph 0.05,0.05,0.05,0.0 -# set xtics min,(max-min)/5,max -# set boxwidth width*0.9 -# set tics out nomirror -set xlabel "x" -set ylabel "Frequency" -#count and plot -plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle +unset xtics +unset ytics +unset border +set xtics out nomirror norotate offset 0,0 +set ytics out nomirror norotate +set ytics in nomirror norotate offset 0,0 +set tics scale 0,0,0,0 + +set xlabel "x" + +set terminal dumb size 100, 25 +plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes notitle diff --git a/scratchpad/plotting/gnuplot/term4.gp b/scratchpad/plotting/gnuplot/term4.gp new file mode 100644 index 0000000..c8f70ca --- /dev/null +++ b/scratchpad/plotting/gnuplot/term4.gp @@ -0,0 +1,26 @@ +reset + +stats 'data.dat' nooutput +# show variables all +max=STATS_max +min=STATS_min + +n=1000 +width=(max-min)/n +hist(x,width)=width*floor(x/width)+width/2.0 + +set xrange [min:max] +set yrange [0:] + +unset xtics +unset ytics +unset border +set xtics out nomirror norotate offset 0,0 +set ytics out nomirror norotate +set ytics in nomirror norotate offset 0,0 +set tics scale 0,0,0,0 + +set xlabel "x" + +set terminal dumb size 100, 25 +plot 'data.dat' u (hist($1,width)):(1.0) smooth freq w boxes notitle