Color Pallete on a 4D plot

it works for me with 5.34 at 6.04 on Mac

   ----------------------------------------------------------------
  | Welcome to ROOT 6.03/03                    http://root.cern.ch |
  |                                   (c) 1995-2014, The ROOT Team |
  | Built for macosx64                                             |
  | From heads/master@v6-03-02-699-g8c3ad7e, Apr 02 2015, 10:05:15 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'     |
   ----------------------------------------------------------------

root [0] .x emix.C
3
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [1] 

try to add an other update:


{
const UInt_t Number = 3;
Double_t Red[Number]    = { 1.00, 0.00, 0.00};
Double_t Green[Number]  = { 0, 1, 0};
Double_t Blue[Number]   = { 0.00, 0.00, 1.00};
Double_t Length[Number] = { 0.00, 0.50, 1.00 };
Int_t nb=3;
Int_t FI = TColor::CreateGradientColorTable(Number,Length,Blue,Green,Red,nb);
cout << gStyle->GetNumberOfColors() << endl;

ntuple->Draw("px:py:pz:px","","colz");
gPad->Update();
htemp->SetContour(nb);
gPad->Update();
}

Ok, it works without compiling the code. Thanks !
And for setting the range, do you have an idea ? If I do htemp->SetMaximum(max) and htemp->SetMinimum(min), it modifies only the palette, not the color of the points.

Yes because the point are already defined. Change the range in the tree drawing

How do I do that ? Is there an option to add on the following line ?
ntuple->Draw(“px:py:pz:px”,"",“colz”);

2nd parameter is the cut

Yes, I know but I don’t want to reduce the range, I want to increase it. On the plot I uploaded a few posts ago, I want my range to be [-0.005,0.005].

Draw an empty frame using gPad->DrawFrame() with the range you need and then draw your ntuple using the option SAME.

Thanks for your suggestion, I made a few tests but I couldn’t find how to draw an empty 3D frame using gPad->DrawFrame()… I used the following function : TH1F * DrawFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, const char* title = “”). The range I need to set is on the fourth dimension… Is it possible to do that ?

Oh sorry … Yes 3D … The solution I gave you is for 2D.

try

   TH3F* h3 = new TH3F("h3", "h3", 10, 0, 14, 10, 0, 8000, 10, -0.004, 0.004);
   h3->Draw();

No because, this sets the range on the third dimension, and what I need is on the fourth dimension…

Ok … tricky … min less than the minimum of the variable and max greater than the maximum of the variable cannot be set on ntuple variables …
I have no answer right now.