The meaning of representing the simplex as a triangle surface in Dirichlet distribution? I'm reading from a book that introduces the Dirchilet distribution and then presented figures about it. But I was not really able to understand those figures. I attached the figure here at the bottom. What I don't understand are the meanings of the triangles.
Normally when one wants to plot a function of 2 variables, you take the value of var1 and va2 and then plot the value of the function value of those two variables ... which gives a visualization in a 3D dimension. But here there are 3 dimensions and one other value for the function value so it makes a visualization in 4D space. I can't understand those figures! 
I hope someone can clarify them please!
EDIT:
here is what I don't understand from figure 2.14a. So we have drawn from K=3 dirichlet a sample theta (which is basically a vector) that is: theta = [theta1, theta2, theta3]. The triangle plots [theta1, theta2, theta3]. The distance from the origin to each theta_i is the value of theta_i. Then for each theta_i it put a vertex and connected all three verteces and made a triangle. I know that if I plug [theta1, theta2, theta3] into dir(theta|a) I will get one number which is the joint probability of the vector theta. I also understand that the probability for continuous random variables is a measure of an area. But here we have 3 dimensions so the joint probability will be the measure of the volume of the space from the pink plane and under ... i.e the pyramid. Now I don't understand what is the role of the triangle here. What is it trying to communicate or visualize?

 A: 
I don't understand what is the role of the triangle here. What is it trying to communicate or visualize?

All points in the triangle must satisfy the two constraints: between zero and one in each dimension ($0 \leq \theta \leq 1$) and all sum up to one ($\theta_0 + \theta_1 + \theta_2 = 1$).
The way I finally understood it is the following:

So (a) shows a 3-D space with $\theta_{1, 2, 3}$ as coordinates. They range only between 0 and 1.
In (b), a triangle is shown, this is our simplex.
(c) shows two example points that "lay" on the simplex which also fulfil the second criteria (sums up to one).
(d) shows another example point on the simplex, the same constraints hold
In (e), I tried to show a projection of the simplex to a 2-D triangle with all example points shown before.
Hope it makes more sense now :)
A: Graph 2.14(a) shows a plane made by three vertices on each axis. The distance of a vertex from the origin is $\theta_i$, corresponding to one of the $k=3$ classes. The region enclosed by the pink plane and the planes of the axes is probability of (vector) $\theta$. Now suppose that you tilt that plane so that you have a pyramid with the pink plane, the face nearest to the reader, placed flat on the page. Then suppress the third dimension "popping out" of the page, and instead color the triangle so that the higher density region, with a longer distance from the base to a surface, is more red. That's what graphs 2.14(b) and 2.14(c) show. The more the red is concentrated near a vertex, the more probable the class associated with that vertex. Likewise, if the red region is not very near to any vertex, it is not especially likely that an event has higher probability of membership in any of the classes.
This pyramid, though, only makes sense as a single realization of the Dirichlet distribution. Drawing again from the same distribution might yield a different pyramid with different lengths $\theta$ to each of the vertices. The key difference between (a) and (b)/(c) is that (a) graphically displays the probability of one draw of vector $\theta$. Graphs (b) and (c) show the probability density for values $\theta$ in the $k=3$ simplex, that is, they're attempting to present the probability density function for all values $\theta$ in the support. One way to think about (b) and (c) is as a point having additional red color according to the average height between the flat pink plane and the surface of the pyramid, averaged over many draws of $\theta\sim\text{Dir}(\alpha)$.
