Managing palette with PyROOT

From: Barbara Storaci <Barbara.Storaci_at_cern.ch>
Date: Mon, 18 Feb 2008 17:21:57 +0100


Dear ROOT experts,
I am using PyROOT and I would like to modify some characteristics of the palette of my 2D histogram. I am trying to set the range of the "palette axis" and to set the number of steps in which I would like to have my palette divided. The problem is that I do not know how to convert the command:

TPaletteAxis *palette=(TPaletteAxis*) h->FindObject("palette")

in Python.  

I tried to write:

    palette = h.FindObject("palette");
    axis = palette.GetAxis()

    axis.SetWmin(0) 
    axis.SetWmax(1.5) 
    axis.SetNdivisions(10) 

where "h" is a TH2F

but I obtain the following error:
" axis = palette.GetAxis()
AttributeError: 'NoneType' object has no attribute 'GetAxis' " while in C++ palette would have pointed to an existing object.

Have you got any suggestions?
Thanks a lot

      Barbara


Barbara Storaci                            mailto:Barbara.Storaci_at_cern.ch
NIKHEF                                                   CERN PH Division
N 254                                                       Bat. 13 1-026
Kruislaan 409                                              Mailbox F26200
1098 SJ Amsterdam                                       CH-1211 Geneve 23
The Netherlands                                               Switzerland
Tel: +31.(0)20 592 2147                           Tel: +41.(0)22.76.76309
GSM: +31.(0)63.8599.204                           GSM: +41.(0)76.20.00632
GSM(Italy): +39.349.7785671 Received on Mon Feb 18 2008 - 17:22:01 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 20 2008 - 17:50:01 CET