Python is dynamically typed, and PyROOT cleverly deals with C++ object types and inheritance. So in ROOT where FindObject() always returns a pointer to a TObject (which you can cast to a TPaletteAxis, if you know its type), PyROOT cleverly does this automatically, so just by calling
You will get a TPaletteAxis object called palette. Some PyROOT objects (I’m not sure if this will work in your situation, but it works for TFiles) go a step further and allow you to find objects within them just by asking for a member:
thanks for your kind reply. As you can see from the code that I’ve attached I’ve already done something very similar. Unfortunately none of the method you suggests helps me in retrieving the palette of the graph. What I obtain is always a None object.
Here comes the newbie question: where is the mistake? What is the correct/best way to retrieve and then manipulate the palette of a graph/histogram in PyROOT?