Visualization of random distribution with 3 variables Suppose I have a joint distribution of three random variables $x,y,z$, $P(x,y,z)$. For simplicity, let's suppose those three rvs. are discrete. The distribution will be represented in Python as a 3-dimensional numpy array. In the cases where there are only 2 rvs., we can plot a surface plot, but in 3 rvs. case, I cannot think of a good way to do it.
My question is, is there a way to visualize $P(x,y,z)$ (preferably in Python)? 
 A: You might want to try a ternary plot. Unfortunately, I'm not sure how to code one in Python, but here's an R version, based on the help for ternaryplot in the vcd package. (You can also try the ggtern package, which uses ggplot2 to create ternary plots):
library(vcd)
data("Hitters")
colors <- c("black","red","green","blue","red","black","blue")
pch <- substr(levels(Hitters$Positions), 1, 1)
ternaryplot(
  Hitters[,2:4],
  pch = as.character(Hitters$Positions),
  col = colors[as.numeric(Hitters$Positions)],
  main = "Baseball Hitters Data"
)
grid_legend(0.8, 0.9, pch, colors, levels(Hitters$Positions),
  title = "POSITION(S)")

As you can see, the plot shows each baseball player's relative performance on three variables--Errors, Putouts, and Assists. In this case, the plot also uses symbols to show each player's field position.

A: You could try to create a dynamic plot, like this one whit shiny. But instead of the user selecting the number of points (as in the example of shiny) you could select the value of the rv that has the smaller number of values.
In other words (from comment), plot a series of surface plots (or 2D density plots) of P(X,Y,Z=const).
