Hello,
I would like to use the default palette for my 2D histogram. I am trying to plot a fraction and the final bin content in fraction_2D ranges between 0 to 0.5. But the plot doesn’t show the values.
Running it on ROOT 5.34.38 shows some errors and warnings. Maybe there’s something going on with the file or data?
ROOT 5.34/38 (v5-34-38@v5-34-38, Mar 12 2018, 15:49:39 on win32)
CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x histtest.C
Error in <TClass::New>: cannot create object of class TH2
Error in <TClass::New>: cannot create object of class TH1
Warning in <TStreamerInfo::BuildCheck>:
The StreamerInfo for version 4 of class TH2 read from the file f4.root
has a different checksum than the previously loaded StreamerInfo.
Reading objects of type TH2 from the file f4.root
(and potentially other files) might not work correctly.
Most likely the version number of the class was not properly
updated [See ClassDef(TH2,4)].
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 4 of class 'TH2' is missing from
the on-file layout version 4:
double fScalefactor; //
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 4 of class 'TH2' is missing from
the on-file layout version 4:
double fTsumwy; //
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 4 of class 'TH2' is missing from
the on-file layout version 4:
double fTsumwy2; //
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 4 of class 'TH2' is missing from
the on-file layout version 4:
double fTsumwxy; //
Error in <TBufferFile::CheckByteCount>: object of class TH2 read too few bytes: 1251 instead of 1283
Error in <TBufferFile::CheckByteCount>: object of class TH2 read too few bytes: 864 instead of 896
Error in <TH2F::Add>: Attempt to add histograms with different number of bins
Error in <TBufferFile::CheckByteCount>: object of class TH2 read too few bytes: 1251 instead of 1283
Error in <TBufferFile::CheckByteCount>: object of class TH2 read too few bytes: 864 instead of 896
Error in <TH2F::Add>: Attempt to add histograms with different number of bins
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
For bin [i,k] = [1,1]
FF = 0
For bin [i,k] = [1,3]
FF = 0.42477
For bin [i,k] = [2,1]
FF = 0
For bin [i,k] = [2,3]
FF = 0.12186
For bin [i,k] = [3,1]
FF = 0
For bin [i,k] = [3,3]
FF = 0.12186
For bin [i,k] = [4,1]
FF = 0
For bin [i,k] = [4,3]
FF = 0.12186
root [1]
Apparently the histograms you start from have some wrongly defined (color) contours defined. That’s what I found while debugging problem. Reseting these contours fixes your problem.