Draw options for TH3F histogram

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Dear experts,

I have constructed a TH3F histogram saved in a .root file and I wish to fix a macro in order to make this histogram a little bit more well presented and easier to read. Searching into some relevant topics I thought I could draw it with an option e.g GLLEGO2 or something similar. At this point, I draw it using the Draw->(“lego”) option which works, but all boxes appear in the same color (here is red). I have also included gStyle->SetCanvasPreferGL(1) and gStyle->SetPalette(1) commands, but with no results. Until now, the only two options working are “lego” and “iso”. I believe I miss something at the very beginning where all the relevant libraries and classes must be included. I attach here my macro (TH3F_test.C) and the drawn TH3F_test.png I take back. I tried to upload the relevant .root input file which contains the TH3F initial histogram, but it seems it is rather bulky.

Thank you very much for any help you can provide.

TH3F_test.C (2.3 KB)

I cannot run your macro because of missing data file.
The plotting option for 3D histograms are listed here:

But recent improvements have been done in that area. It might be you have a too old version of ROOT (you did not give the details about your ROOT version and system you are using).

Thank you, Couet, for your quick response. The truth is I used ROOT 5.34 version. After your reply, I tried ROOT 6.10. My system is Ubuntu 16.04 LTS. I have also removed the gROOT->LoadMacro(“AtlasStyle.C”); SetAtlasStyle(); lines since they produced the following error (in ROOT 6.10):

error: use of undeclared identifier 'SetAtlasStyle'

and replaced it with #include “AtlasStyle.C” at the beginning of the macro. After that, the macro operates producing the same image when used the Draw(“lego”); option. I tried to use “GLLEGO2”, but it resulted to a blank histogram (produced only the canvas and the legend). I have also tried almost all the rest draw option mentioned in the page you have sent me without any different result.

I also tried to compress the input root file in order to attach it and see for yourself, but it still is rather big and I do not have any other suitable and smaller. If there is any other suggestions about what maybe goes wrong, I am open to them. Thanks again.

Problem finally solved…!! It seems that “BOX2 Z” option works really fine within the existing macro. Thanks again for the boost.

Just to make it totally clear… it works totally fine for ROOT 6.10 . I gave it a shot again with 5.34 version without any luck. The problem was the ancient ROOT version I used.

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