# visualizing orientation (zenith and azimuth) data (e.g. with a circular or spherical histogram)?

I want to understand the distribution of orientation angles in a 3D image (represented as a triangular mesh).

For each triangle in the image I have zenith ($\Theta$) and azimuth ($\phi$)

And I can compute histograms for each:

Is there a way that I can combine the information contained in these images into a single histogram representing the joint distribution of these variables?

• Can you give more details on the actual problem? What prevents you from doing the same you did in 1D also in 2D? Jul 7, 2014 at 20:28
• I'd like to wrap these circular distributions, e.g. so that the values of $\phi$ meet at $\pm \pi$ Jul 7, 2014 at 20:38
• the actual problem is related to 3D realizations of a plant canopy, as described in Song et al 2013 to summarize the distribution of leaf elements in a plant canopy. Jul 7, 2014 at 20:53
• It seems no real problem if this wrapping is your only point. Just choose an histogram-grid $z_j$ such that the boundaries are either connected (e.g. regions $[-1,-0.9], ... , [0.9,1]$) or wrap into the other end (e.g. $[-0.95,-0.85] ... , [0.95,-0.95]$). Jul 8, 2014 at 8:05

The way to determine a two-dimensional histogram is very similar to the one-dimensional case.

Basically in 1D, you sum up all knots within a certain interval or bin. That is for $\varphi$, you count all points in the "beam" $\varphi \in [\varphi_i-\Delta \varphi_i, \varphi + \Delta \varphi]$, $\theta \in [-1,1]$, and divide by the total number of points. This procedure can be seen to give a Monte-Carlo estimate of the integral

$$P_i =\int_{\varphi_i-\Delta \varphi}^{\varphi_i-\Delta \varphi} d\varphi \int_{0}^\pi d\theta \, \sin(\theta) \ p(r,\varphi, \theta)\\ =\int_{\varphi_i-\Delta \varphi}^{\varphi_i-\Delta \varphi} d\varphi \int_{-1}^1 dz \ \tilde p(r,\varphi, z)=\frac{N_i}{N}$$

where $p(r,\varphi, \theta)$ is the density which generates the points (which admittedly will hardly become continuous for your picture), and $\tilde p(r,\varphi, z)$ is the transformed density for $z=\cos \theta$.

In result, you get for each azimuthal grid point $\varphi_i$ a real number $P_i$ (alternatively, you can also plot unnormalized values $N_i$). The same goes for $z_j$ (caution: due to the volume element of the sphere, if you look for equally space bins, you have to work in the transformed coordinate $z$, otherwise you won't get consistent bin-volumes).

Similarly, in the two-dimensional case, you span a two-dimensional grid of regions $\varphi \in [\varphi_i-\Delta \varphi_i, \varphi + \Delta \varphi]$, $z \in [z_j - \Delta z,z_j + \Delta z]$, count the number of knots and obtain the coresponding approximate probabilities $P_{ij}$. Finally, you simply plot the data in a 3D picture with the data given in the form

$$\varphi_i, \ z_j, \ P_{ij}$$

Such three-dimensional plots are supported by almost any plot program.

• Despite the unfortunate wording at the end, this question makes it clear that the data consist of $(\theta,\phi)$ pairs describing points on a sphere. The approaches you suggest will not work correctly because they are designed for Euclidean density estimates. Moreover, the area elements in your integrals, $d\phi d\theta$, are not the correct ones for the sphere.
– whuber
Jul 7, 2014 at 19:43
• Thanks for your point, I made a rough correction. I'll further ask the OP for more details. Jul 7, 2014 at 20:25

Given that you're ignoring r for each triangle, your coordinates describe points on a sphere and your problem corresponds to visualization of data across longitude/latitude values. The good news is that that's a well-studied problem with lots of tools available. The bad news is no really good solutions have been found for representing a globe in 2D. Nonetheless, it's such a common problem that we've come to accept the limitations of a few common projections. A 2D heatmap with a map projection may be useful.

• you can take a look of the software visumap that enables you to embed high dimensional data into 2d or 3d manifolds (like sphere, projective plane, S3, etc.) and provides interface for interactive exploration. Jul 8, 2014 at 5:24