forked from personal/squiggle.c
add some gnuplot commands
This commit is contained in:
parent
6010d99cba
commit
ec9e2e89e0
22
scratchpad/plotting/gnuplot/command-png.gp
Normal file
22
scratchpad/plotting/gnuplot/command-png.gp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
reset
|
||||||
|
n=100 #number of intervals
|
||||||
|
max=3. #max value
|
||||||
|
min=-3. #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 term png #output terminal and file
|
||||||
|
set output "histogram.png"
|
||||||
|
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
|
19
scratchpad/plotting/gnuplot/command-terminal.gp
Normal file
19
scratchpad/plotting/gnuplot/command-terminal.gp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
reset
|
||||||
|
set terminal dumb size 80, 25
|
||||||
|
n=100 #number of intervals
|
||||||
|
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
|
1000000
scratchpad/plotting/gnuplot/data.dat
Normal file
1000000
scratchpad/plotting/gnuplot/data.dat
Normal file
File diff suppressed because it is too large
Load Diff
BIN
scratchpad/plotting/gnuplot/histogram.png
Normal file
BIN
scratchpad/plotting/gnuplot/histogram.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
Loading…
Reference in New Issue
Block a user