#!/usr/bin/env python
"""
This script shows a problem with the way the y-axis scaling is defined
for histograms.
"""

from setPath import *

import hippoplotter as plot
import random

evts = []
nsamp = 1000
for i in xrange(nsamp):
    evts.append(random.random())

hist = plot.histogram(evts)

#
# getRange and setRange should behave consistently, i.e., using the
# output of getRange in setRange should *not* change the plot.
#

yr = hist.getRange('y')

plot.prompt("Hit return to see the plot y-axis change "
            + "even though it shouldn't:")

hist.setRange('y', yr[0], yr[1])




