Re: [AMBER] cpptraj hist 3D

From: Jason Swails <>
Date: Thu, 6 Nov 2014 09:29:21 -0500

> On Nov 6, 2014, at 7:54 AM, CHAMI F. <> wrote:
> Dear Amber user,
> is there a way to represent a 3D histogram from output of hist in cpptraj
> hist phi1 phi2 phi3 min -180 max 180 bins 72 out hist_id_20.gnu
> 2D histogram is fine in gnuplot using: splot "-" with pm3d title “hist.gnu"

N-dimensional data requires N+1 dimensions in order to display the full function. That is why a 2D histogram appears like a surface.

By extension, a 3D histogram requires 4 dimensions to plot the full function. In a standard plot, this is clearly impossible. The trick then becomes how to reduce the dimensionality to 3 or fewer dimensions so you can plot it.

A common approach is to simply plot a relevant contour map, so plot the surface representing a particular value of the histogram, as a function of the three dihedrals (this is what is done, for instance, with wavefunctions and orbitals in electronic structure calculations). You can plot multiple values at different transparencies, similar to a contour map in 2 dimensions of, say, a mountain range.

Another approach is to plot “slices” -- that is, plot a surface of phi1 and phi2 for incremental values of phi3. The best approach is the one that most clearly conveys the conclusions you wish to convey from the data.

I’ve never tried to do this myself, and the only software I know of that does this “easily” is Mathematica (although Octave and Matlab documentation suggests it’s possible there). I don’t know if gnuplot can do this.


Jason M. Swails
Rutgers University
Postdoctoral Researcher
AMBER mailing list
Received on Thu Nov 06 2014 - 06:30:02 PST
Custom Search