You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What appears to be happening is that the axes on the left-hand side and bottom of the plot matrix are taken from the nearest cell. For categorical variables, this means that left-hand axes contain frequencies from the histogram, which makes it impossible to tell which block corresponds to which category level. One can try to eye-ball it from the bottom axis, but if there is a quantitative variable there, the bottom axes become histogram frequencies, and so the category axes are lost altogether.
Since exact histogram counts are not very useful in this situation, perhaps the axes should be taken from one of the other plots? I am insufficiently well-versed in the ggplot2 API to say how.
Minimal example
library(GGally)
df<-data.frame(x= sample(letters[1:2], 100, replace=TRUE),
y= sample(letters[1:2], 100, replace=TRUE),
z= rnorm(100))
# Only categorical columns: vertical axis has frequencies, horizontal has category labels.
ggpairs(df, columns=1:2)
# Quantitative column at the end: frequencies everywhere, category labels lost.
ggpairs(df)
What appears to be happening is that the axes on the left-hand side and bottom of the plot matrix are taken from the nearest cell. For categorical variables, this means that left-hand axes contain frequencies from the histogram, which makes it impossible to tell which block corresponds to which category level. One can try to eye-ball it from the bottom axis, but if there is a quantitative variable there, the bottom axes become histogram frequencies, and so the category axes are lost altogether.
Since exact histogram counts are not very useful in this situation, perhaps the axes should be taken from one of the other plots? I am insufficiently well-versed in the
ggplot2
API to say how.Minimal example
Created on 2022-06-12 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: