Plots and data analysis
Useful Python/Matplotlib, scripts created over the years.
Histogram of dihedral angles
From a file dihedral angle (from MD simulation), plot a histogram of the data with a set number of bins. Also allows fitting of normal distribution.
Plotting energy/gradient profile of single-point energy jobs
From a collection of single-point ORCA outputfiles in directory (that are alpha/numerically ordered) plot the energy profile.
If gradient is present (i.e. an Engrad job) the gradient can be plotted as well and shown on plot with shared x-axis.
Plotting multiple absorption spectra from ORCA orca_mapspc .dat files in dir
- Human sorting of filenames
- Automatic filename-based legends (removes suffix)
- Easy modification of colors.
- Option to shift spectra by a constant energy.
- Option to set y-value 0 if larger than some value. Useful for XAS spectra if one is not interested in the usually-wrong-looking rising edges.
- Removes scientific notation in x-axis.
Matplotlib Script to read simulation trajectory data from file and plot (to be refined)
Usage:
./plot_traj.py simulation.prot -temp/-epot/-ekin/-etot
where simulation.prot contains tabulated data:
#Step time[ps] E_pot[au] E_kin[au] E_tot[au] T[K] F_c[au] Fric 1 0.001000 120856.223512 6.129615 120862.353127 264.48 0.0000e+00 0.000e+00 2 0.002000 120855.634232 6.319493 120861.953725 272.68 0.0000e+00 0.000e+00 3 0.003000 120855.382219 6.599810 120861.982029 284.77 0.0000e+00 0.000e+00 4 0.004000 120855.232159 6.746517 120861.978677 291.10 0.0000e+00 0.000e+00 5 0.005000 120855.150638 6.836964 120861.987602 295.00 0.0000e+00 0.000e+00 6 0.006000 120855.060382 6.927220 120861.987601 298.90 0.0000e+00 0.000e+00 7 0.007000 120854.958470 7.028841 120861.987311 303.28 0.0000e+00 0.000e+00Simple scatterplot with connecting lines and removed borders
Molecules rendered in VMD with Povray. Assembled using Keynote.
Simple vertical energy plot
Matplotlib energy diagram.
Modified version of energy_plot by Felix Plasser: http://homepage.univie.ac.at/felix.plasser/chemprogs/python.htm
Alternative energy diagram:
Matplotlib scatterplot with fixed x-axis:
Matplotlib contour plot for 2D PES plot
(x and y values are the values of the reaction coordinates or constraints in constrained optimizations). Energy is the color dimension.
File "files" here contains list of files (one per line) with the name of the x and y coordinates, e.g. 100_-100.mpi12.out (100 and -100)
File "energies" here contains list of energies (one per line) in hartrees.
Matplotlib bar graph with scatter data
By Bardi Benediktsson.
Nice way to plot two different kind of data. In this case, we are interested in number of unbound electrons and RMSD as a function of a functional.
Matplotlib bar graph with multiple bars with both negative and positive y-values.
By Bardi Benediktsson.
Multiple bars for each functional to depict the deviation of calculated values to the crystal structure. The way that the x-axis is made is rather dumb as I couldn't find information of how to easily implement at the 0.0 Å. The line is composed of very small and wide bars, which makes it look like a line. This can definitely be improved or performed in a better way.