Reading histograms from files created by CFBook C++/Fortran
Source code name: "CFBookH1D.py"
Programming language: Python
Topic: File IO/HBook
DMelt Version 1.4. Last modified: 06/04/1975. License: Free
https://datamelt.org/code/cache/CFBookH1D_7247.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


# Run this example in DataMelt
# This example reads histograms  created by C++/Fortan CFBook package
# See: https://datamelt.org/?id=cfbook-library

from java.awt import Color
from java.awt import Font
from jhplot  import *
from jhplot.io import *

hb = CFBook()
hb.read("fortran.xml")
print hb.listAll()
print hb.getKeysH1D() # list keys

h1=hb.getH1D(1)
c1=HPlot("Test")
c1.setGTitle("Histograms from a file");
c1.visible(1)
c1.setAutoRange()
c1.draw(h1)