test.C (249 Bytes)
file.root (32.6 KB)
Hi, I have a TH3F histogram and I cannot draw it with the glcolz option. I have attached the script and the root file, as well as the image produced. Using a transfer function for making empty bins transparent does not help. I would be very grateful for any suggestions on how to draw this histogram.
_ROOT Version: ROOT 6.10/08
_Compiler: c++/4.2.1, Apple LLVM version 9.1.0 (clang-902.0.39.2)
thanks. I will look. Does it work with other 3D options like BOX ?
Your historgam puts ROOT is a strange state. When I draw it with the option BOX only (no opengl) the view is blocked. I cannot rotate it. I see also some red line (coming from the list of functions I guess)
Thank you for your reply. The glbox option works, but there is no colour palette info.
The following works:
TFile* file = new TFile("file.root","READ");
TH3F* hist = (TH3F*) file->Get("hist");
hist->Draw("box2 Z ");
I guess the red line is the function liked to the TH3
It was produced with a script analysing a huge ASCII file, and which has drawn the histogram following the use of the transfer_function which made the empty bins transparent. Then I wrote the 3D histogram to a another root file, so I can open it directly, without reading the huge ASCII file again. But it had already used the transfer function method which I got from post https://root-forum.cern.ch/t/th3-and-glcolz-option/14604
may be @tpochep may have an idea.
I attached two scripts to illustrate how using the transfer function prior to writing the histogram to the file causes this behaviour.
So I now know not to use the transfer function until the very end, prior to the final drawing.
Thank you for looking into this,
DoItThisWay.C (1.05 KB)
DontDoItThisWay.C (1.28 KB)
file.root (31.3 KB)
the root file you sent does not contain the
$ rootls file.root
I cannot use rootls:
Cristians-iMac:Downloads cristian$ rootls file.root
Traceback (most recent call last):
File “/Users/cristian/root/bin/rootls”, line 10, in
ImportError: No module named cmdLineUtils
but if I check:
Cristians-iMac:Downloads cristian$ root file.root
[...] $ rootls -l file.root
TH3F Jul 05 10:05 2018 hist "3D"
You are right … I must have had an other file.root. (I have many file.root, test.root, etc … downloaded from this forum
yes the macro “DoItThisWay.C” works fine.
Sorry for the confusion caused by naming it file.root. But I bet I am the first one with DoItThisWay.C and DontDoItThisWay.C
Yes you are and that’s all my fault I should have been more careful… sorry again …
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.