File: Histogram

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (29 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (5)
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

   // Import the data
electrondensity = Import("watermolecule");
   // Partition the data
electrondensity = Partition(electrondensity);

   // The macro creates a histogram, colors it, and turns it into a 2D 
   // plot
macro dohistogram(bins,min,max)
{
  histogram = Histogram(electrondensity,bins,min,max);
  colored = AutoColor(histogram);
  colored = Scale(colored,[2000 1 1]);
  plot = Plot(colored);
  camera = AutoCamera(plot,aspect=1);
  Display(plot,camera);
}

  // use defaults
dohistogram();
  // specify the bins, and what range to look at
dohistogram(50,0.1,1.0);