datarep = sthist.getDataRep()

print "Histogram :"
print "  Title : " + sthist.getTitle()
print "  Entries : %i" % sthist.numberOfEntries()
print "  Mean = %f" % datarep.getMean ( 'x' )
print "  Rms  = %f" % datarep.getRMS ( 'x' )

# Print the average X value on the display
canvas.selectDisplay ( sthist)
canvas.addTextRep ( sthist, 'averagex' )
canvas.selectDisplay ( dyhist)
canvas.addTextRep ( dyhist, 'averagex' )

# Get the contents of the bins as a DataArray
high = sthist.createDataArray()
low  = sthists.createDataArray ()

# Take difference with high statistics one scaled down, and a column
# to the low one.
low[ 'diff' ] = high[ 'Entries / bin' ] / 10 - low[ 'Entries / bin' ]

# Create an XY plot to see the difference
xyplot = Display ( "XY Plot", low, ( 'X', 'diff', 'nil', 'Error' ) )
canvas.addDisplay ( xyplot )
low.register ('difference ntuple' )

print "Static histogram is on the left, dynamic one on the below it."
print "You can changing the binning of the dynamic one with the Inspector"
print "\nOn the right we have low statistics gaussian with difference"
print "between it and high statistics plotted below it"