Setting Y axis range in Tree histogram

Hi,

I’m trying to restrict the plot range of a simple tree plot like so:

    theTree.Draw(drawParams, _settings['drawFilter'], _settings['drawStyle'])
    htemp = TH2F(gPad.GetPrimitive("htemp"))
    htemp.GetXaxis().SetLabelSize(0.03)
    htemp.GetYaxis().SetLabelSize(0.03)
    if 'yrange' in _settings:
        htemp.SetMinimum( _settings['yrange'][0] )
        htemp.SetMaximum( _settings['yrange'][1] )
    htemp.Draw()

This succeeds in changing the label size, but not the axis range.

Any ideas what I’m doing wrong here?

TIA & regards,
Roland

Try adding a print statement (as above) to make sure you are really inside the loop. I have successfully used SetM{in,ax}imum in PyRoot.

Cheers,
Charles