-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistogram.gnuplot
35 lines (27 loc) · 903 Bytes
/
histogram.gnuplot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
clear
reset
set samples 500
set key off
set border 3
set yzeroaxis
set boxwidth 0.1 absolute
binwidth = 0.1
set boxwidth binwidth
sum = 0
s(x) = ((sum=sum+1), 0)
bin(x, width) = width*floor(x/width) + binwidth/2.0
set multiplot
set xr [-2:2]
unset ytics
unset xtics
unset border
set size 1.,1./2.
set origin 0./2.,1./2.
plot "cmake-build-release-mpi/samples0.dat" u ($1):(s($1)) lt rgb "#FF0000"
plot exp(-(x*x - 1)*(x*x - 1)) lt rgb "#000000" lw 2
plot "cmake-build-release-mpi/samples0.dat" u (bin($1, binwidth)):(1.0/(binwidth*sum)) smooth freq w boxes lt rgb "#FF0000" lw 1.5
set size 1.,1./2.
set origin 0./2.,0./2.
plot "cmake-build-release-mpi/samples1.dat" u ($1):(s($1)) lt rgb "#0000FF"
plot exp(-30*(x*x - 1)*(x*x - 1)) lt rgb "#000000" lw 2
plot "cmake-build-release-mpi/samples1.dat" u (bin($1, binwidth)):(1.0/(binwidth*sum)) smooth freq w boxes lt rgb "#0000FF" lw 1.5