commit 7bc29b9e3d75bd90481e6651fec4e45663d7ecdb
parent 456fbaf05197da8a192851081a38ba2af9d9869d
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Tue, 30 Jan 2024 14:52:25 +0100
Savepoint plotting
Diffstat:
4 files changed, 66 insertions(+), 17 deletions(-)
diff --git 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
@@ -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
@@ -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
+
+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 ylabel "Frequency"
-#count and plot
-plot "data.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle
+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
@@ -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