GNUPLOT can be used to generate histograms.
The script below allows one to plot variations in angle from 0° to 180°.
Each histogram box width correspond to 3° (covered here under bw option).
To execute this script; type this in the terminal:
gnuplot histogram.p
You should be in the folder where below script is saved in a file name "histogram.p" and a dat file (here, it is N---H-O.dat) should be present.
histogram.p
------------------
set term gif
set output "angle_N---H-O.gif"
set xrange [0.0:180.0]
set boxwidth 2.0 absolute
set style fill solid 1.0 border -1
set xtics 10
set title "molecule 3.0A Angle N---H-O"
set ylabel "occurance"
set xlabel "angle"
bw = 3 # substitute what you want
bin(x,width)=width*floor(x/width)
plot 'N---H-O.dat' using (bin($2,bw)):(1.0) smooth freq with boxes
------------------
The dat file is an input file with data in the format:
0 23.680344
1 73.766251
2 67.482254
3 52.086418
4 72.886803
5 54.009365
6 36.297497
7 35.184067
8 162.915512
9 52.081470
10 49.975559
11 46.514202
12 45.990093 ..............
Two columns where the second column refers to bond angles. First column here gives molecular dynamics steps.
On execution a gif file (here,angle_N---H-O.gif) will be created which looks something like this:
The script below allows one to plot variations in angle from 0° to 180°.
Each histogram box width correspond to 3° (covered here under bw option).
To execute this script; type this in the terminal:
gnuplot histogram.p
You should be in the folder where below script is saved in a file name "histogram.p" and a dat file (here, it is N---H-O.dat) should be present.
histogram.p
------------------
set term gif
set output "angle_N---H-O.gif"
set xrange [0.0:180.0]
set boxwidth 2.0 absolute
set style fill solid 1.0 border -1
set xtics 10
set title "molecule 3.0A Angle N---H-O"
set ylabel "occurance"
set xlabel "angle"
bw = 3 # substitute what you want
bin(x,width)=width*floor(x/width)
plot 'N---H-O.dat' using (bin($2,bw)):(1.0) smooth freq with boxes
------------------
The dat file is an input file with data in the format:
0 23.680344
1 73.766251
2 67.482254
3 52.086418
4 72.886803
5 54.009365
6 36.297497
7 35.184067
8 162.915512
9 52.081470
10 49.975559
11 46.514202
12 45.990093 ..............
Two columns where the second column refers to bond angles. First column here gives molecular dynamics steps.
On execution a gif file (here,angle_N---H-O.gif) will be created which looks something like this:
Comments
Post a Comment