'R GGally::ggpairs correlation matrix: How to insert scales between cells and how to specifically change the size of each row/column
I draw a correlation plot from iris data for explanation.
p <- iris %>%
dplyr::select(Sepal.Length, Petal.Length, Species) %>%
ggpairs(mapping = aes(color = Species),
lower = list(continuous = "smooth"),
diag = list(continuous = wrap("densityDiag", alpha = 0.5))
) +
theme_classic()
p
I have two questions.
- See the following figure. The y-axis surrounded by the red rectangle is the axis for the density plot. That scale does not work for the right bar plot. Then, I want the axis for the bar plot around either of blue rectangles. Is it possible?
- Is it possible that the size of each row/column is changed specifically? The following image shows an example of change of the width of the 3rd column.
Thank you very much.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
