I'd like to plot a set of 3d point coordinates (x,y,z) as three 2d scatter plot panels in an "orthogonal view":
As a minimal example, let's consider the following data frame:
x <- c(0.9, 1.1, 1.0)
y <- c(2.0, 1.9, 2.1)
z <- c(3.1, 2.9, 3.0)
df <- data.frame(x,y,z)
Now, I'd like to create three plots, such as:
p1 <- ggplot(df, aes(x=x, y=y)) +
+ geom_point() +
+ theme_minimal()
p2 <- ggplot(df, aes(x=z, y=y)) +
+ geom_point() +
+ theme_minimal()
p3 <- ggplot(df, aes(x=x, y=z)) +
+ geom_point() +
+ theme_minimal()
... and arrange them in a way that the x and y axes align.
Is that something I can do using facets, and if so, how?