Dear all,
I have a macro which draws 2D histograms with different color palettes in the same pad.
They do essentially what is described here:
root.cern.ch/drupal/content/how- … ame-canvas
With the difference that, instead of using just:
TExec *ex1 = new TExec("ex1","gStyle->SetPalette(1);");
It does the trick with a custom class (TMPalette), which handles better the use of new customized palettes in root:
TExec *ex1 = new TExec("ex1","myPalette->cd();");
All my palettes (TMPalette objects) are defined in a separated macro (Palettes.C),
and they are nicely used by the example macro: testPalettes.C.
However, as soon as I try to dynamically create a new palette (not present in Palettes.C) in the same macro which draws the histograms, TExec complains that the new palette “is not defined in the current scope…”
I have attached a tar.gz file with the minimal necessary files to reproduce the problem.
Extract it, go to the directory palettes, do make and run testPalettes.C macro for the good case and testPaletteBad.C macro for the problematic one:
palettes.tar.gz (6.16 KB)
Any help would be highly appreciated. I am stuck with this issue and I really need it.
Thanks!