Updating Dr. Berendsen's Python programs

(3) Histograms

To (2)      To (4)      To Workbench Python

Updating Python Code 2.2 (p.171) for Figure 2.3 (p.8)
<Revised code2.2.py>

Let us express in histograms the cumulative data obtained in Part (2). The revised code2.2.py reads 30 experimental data xi (i=1..N) from the csv file (contents), defines the array binsi, and invokes hist, giving the output in the right.

Dr. Berendsen originally wrote the following code.

  1. from plotsvg import *
  2. hisx = [6.5, 7.5, 8.5, 9.5, 10.5, 11.5]
  3. hisy = [1, 7, 8, 10, 2, 2]
  4. f = Figure()
  5. f.frame([6,12],title='Histogram')
  6. f.plotp([hisx,hisy],symbol='halfbar,symbolfill=Darkgrey, symbolstroke=Black)
  7. f.show()
<Graphics output from the revised code>

9-18-2023, S. Hayashi