I would like to draw a set slices of a TH3D in a 3D view. In other words: I would like to have a 3D coordinate systems and at several z positions, I would like to add planes in which TH2s with option “colz” are drawn. The TH2s should show only the content of the TH3 with the given z of the plane.
I know how to get the corresponding TH2. For example, to get the plane at bin z=50, I could do:
But I have no idea how to draw this TH2D in a plane with z=50 in a 3D coordinate system.
Do you have an idea how to do this?
I also thought about the following trick: One might copy the TH3D into a new one, but only fill the bins in the selected slices. Then, one could draw the new, filtered TH3D with option “BOX2Z”. But then, one would have to make sure that the scaling of the boxes is chosen such that they all have the same size, namely exactly the voxel size without any gap. Is there a way to achieve this?
I found this post. Here, it was supposed to use an TNtuple with four entries: x,y,z,val. Then, one draws the tuple with option “col” or “colz” as
Unfortunately, for me (root version 6.20.00), only the first point of the ntuple is drawn and its fourth component determines its color. If I enter only
then I get a TPolyMarker3D with all points, but they of course all have the same color.
I already considered BOX2. But the problem is, that I don’t want to have the gaps between the entries which is a result of the scaling of the box size. I there a way to fix the box size to the size of the 3D bins while still maintaining the color scale?