3.21 Reading histograms from external programs

One can display histograms created by an external C++ or FORTRAN program using the HBook class. For this, use the CFBook library [13]. This package generate 2 static libraries : libcbook.a (to be linked with C++) or libfbook.a (to be linked with FORTRAN).

Then one can read histograms filled by the CFBook library as shown in the examples hbook.py (for 1D) or hbook2D.py.

>>> from jhplot  import HBook 
>>>
>>> hb = HBook()        # create HBook instance 
>>> hb.read("cpp.xml")  # read output file "cpp.xml" from the CFBook package
>>> print hb.listH1D()  # list all histograms
>>> h1 = hb.getH1D(10)  # get H1D histogram with ID=10
>>> c1.draw(h1)         # draw it