Plots a mosaic plots

data(movies, package = "ggplot2")
ggally_ratio(movies[,c("mpaa","Action")])

plot of chunk ggally_ratio

ggally_ratio(movies[,c("mpaa","Action")]) + ggplot2::coord_equal()

plot of chunk ggally_ratio

nummpaa <- length(levels(movies[,"mpaa"]))
numAction <- length(levels(as.factor(movies[,"Action"])))
ggally_ratio(
  movies[,c("Action","mpaa")]
) + ggplot2::theme(
  aspect.ratio = nummpaa / numAction
)

plot of chunk ggally_ratio