Z (bad) label for palette axis in TH3D

Dear ROOTers,

I’ve noticed that, at least in ROOT 6.18, the palette axis takes its title after Z axis of the histogram. It can’t be modified by palette->GetAxis()->SetTitle(“aaa”) - it has no effect. I attach a sample script to reproduce this error.

test_th3d.C (367 Bytes)


_ROOT Version: 6.18
Platform: Fedora 31


I see the issue too. I filled a JIRA ticket:
https://sft.its.cern.ch/jira/browse/ROOT-10730

Thanks. Is there any workaround for time being? Apart from covering the label with self-created TPave :slight_smile:

I had no time to look at it in details yet … sorry . . this needs a fix.
back on it now.

I found the culprit. This is the new CJUST option which does:

   // import Attributes already here since we might need them for CJUST
   fAxis.ImportAxisAttributes(fH->GetZaxis());

in TPaletteAxis::Paint. May be @OSchaile will have an idea about it. Meanwhile you may create a JIRA report with that ?

I could create a report, but I have no idea what CJUST is and googling it is not easy…

Hi
It is correct that:

  fAxis.ImportAxisAttributes(fH->GetZaxis());

is the problem. It imports the title from the z-axis overwriting
its own set by SetTitle
But this existed at least already in 6.18.00 so before option
CJUST was implemented, I guess one never could have
different titles for Zaxis and the Palette.
I just moved this line a bit up in code.
Anyway:
I will look for a fix.
The simplest way would be to save the title before Import…
and restore afterwards but may be there is a more elegant one.

Have a nice Labor Day and stay healthy
Otto

Hi,
if you desperately need this feature before a fix is provided
you might try the attached workaround:
test_th3d_OS.C (920 Bytes)
This replaces the original PaletteAxis with a new one with
the desired title.
Otto

Ahh, I see. Thank you!

Thanks Otto, I will look if something can be done in case of TH3. It is true that for TH3’s it makes no sense to have the palette title equal to the Z-axis title.

Maybe you could define a “T-axis” (ROOT already defines and uses 4 special variable names “x”, “y”, “z”, “t”).

Yes that would make the change to the palette axis title easier for TH3 … instead of doing FindObject etc … I will think about it.
Or a mechanism to directly set the palette title …

I made a proposal for a quick fix here:
(save and restore palettes title if needed)
https://sft.its.cern.ch/jira/browse/ROOT-10730
but may something more general as Wile proposed
is useful
Otto

The t axis would be nice. It could be followed by future (I don’t think they exist but I didn’t check) projections to 3D like xyt, xzt, etc.

(actually I wanted to ask if it is possible to draw a TH3 with 3D projections (TH2) on 3 walls)

you can try the GL options https://root.cern/doc/master/classTHistPainter.html#HP290

I meant something that looks similar to surf3 for TH2, however instead of surf drawing TH2 projection on TH3’s wall.

Patch is applied

Works, thank you