[Z (bad) label for palette axis in TH3D

Continuing the discussion from Z (bad) label for palette axis in TH3D:

Dear Mr. Couet,

Could you please let me know how this was fixed/patched? I am using root 6.26/06 and get the same issue with a TH3D. The palette axis label is the same as the z axis.
Thanks in advance!

Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.26/06
_Platform: OSX 12.6
Compiler: Not Provided

Sorry, I do not remember. That’s an old think. Can you provide a small example showing the problem you encounter?

Hi, the problem is that the zcol showing the palette appears with the same title as the z-axis of a 3D histogram. This is not correct since the color code corresponds to the bin content. See below the plot I generated with my (very long) macro.

Thanks in advance!


void testTH3Title() {
   auto C = new TCanvas();
   TRandom3 r;
   int nBins = 3;
   int nEvents = 1000;
   double minRange = 1; double maxRange = 5;
   TH3D* h4 = new TH3D("h4", "h4-Title",
                       2*nBins, minRange, maxRange,
                       nBins , minRange, maxRange,
                       nBins , minRange, maxRange);

   for ( Int_t e = 0; e < nEvents; ++e ) {
      Double_t x = r.Uniform(0.9 * minRange, 1.1 * maxRange);
      Double_t y = r.Uniform(0.9 * minRange, 1.1 * maxRange);
      Double_t z = r.Uniform(0.9 * minRange, 1.1 * maxRange);
      h4->Fill(x, y, z, 1.0);
   h4->Draw("box2 z");

I agree, the Z title should not de displayed along the palette.

This PR fixes this issue:

Thanks to have seen it.

@couet Maybe you could implement:

Yes that’s also an option. The fix I did makes it at least coherent for the axis with have now. @moneta what about a such new T axis ?

Thank you very much.
Are you planning to add this fix to the next ROOT release?

the T Axis? I am not sure, I would prefer that @moneta gives his point of view.
The fix is in the master now. The palette has no title in the case of TH3.

I agree to have a function for TH3 like h4->SetTitle("h4-Title;XXXXX;YYYYY;ZZZZZ;TTTTT");, but I would not like having another axis stored inside the histogram class. We should think about a solution for setting correctly the palette axis of a multi-dim histogram


Hi, I just installed the new ROOT release (6.28/00) on my Mac (OSX 12.6) and the problem is still there. Do you have a hint when the fix will be released?
Thanks in advance.

I applied the fix in the master version only.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.