# Modified Cartesian

Dear All,

When we try to visualize a 3D histogram, the data is displayed in a normal Cartesian system. I mean the three arises are normal to each other. Is there a way that we can implement a modified coordination system with z axis tilted to y axis by e.g. 30 degree?

Thanks,
Yonggang

you mean the “three axis” I suppose ?

No, this cannot be changed.

My actual question is the following:

I have data for a sampled 3D space. The positions of the sampling points are:

x = 0,1,2,…
z = 0, 1sqrt(3)/2, 2sqrt(3)/2, 3sqrt(3)/2, …
y depends on z:
For even z (0, 2
sqrt(3)/2, …), y = 0, 1, 2, …
For odd z (1sqrt(3)/2, 3sqrt(3)/2, …) y = 0.5, 1.5, 2.5,…

Apparently, in z-y plane, the sampling points are aligned along lines parallel to z = ysqrt(3) and z=-ysqrt(3).

I would like to display the data in something like TH3D. I mean, each point has a small cubic (of course, here it is not cubic) with density display proportional to the value at this point.

How can I do that?

Thanks.

Fill a TH3D with (x,y,z) and W (weight) the size of the box is given by w.
and plot it.

The problem is that the y value is different at different z planes. If I use TH3D, the bin (along y) will be the same for different z planes. For example, for z = 0, I may have y = 0, 1, 2… And for z = 1, I may have y = 0.5, 1.5, 2.5, … Then when z = 2, the y is going back to 0, 1, 2, …

If I set the bins along y as 0, 0.5, 1, 1.5,… How do I treat the missing values at every other bins? Assume that we don’t want to do interpolation here, and just need to show the raw data.

Thanks.

I am not sure to fully understand what you mean … but missing values are simply empty bins seems to me.

Continue my last post.

If I use a bin set, like 0, 0.5, 1, 1.5, 2, …, there won’t be values for bins 0.5, 1.5, 2.5… when z = 0. When I draw the TH3D, there will be a gap between 0, 1, 2 … So, the visualization of the entire field of view will have discontinuity and look ugly.

you can try this:
root.cern.ch/root/html534/THistP … html#HP29c