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
Would having ticks in ggcorr plots help anyone else? With short names the plots are easy to read, but with longer names I find it difficult. I'm happy to try to submit a PR if there is interest. This is how I've been adding them manually
library(tidyverse)
library(patchwork
library(GGally)
set.seed(123)
# sample datarecoded_data<-matrix(rnorm(n=1000), ncol=25)
colnames(recoded_data) <- sapply(1:ncol(recoded_data), function(x){paste0(sep="", collapse="", sample(c(letters, 1:9), size=10, replace=T))})
# this is how much of an overhang happens on the left side of the tick, to connect to the variable nametaglen=.2# here I manually make the data defining the little carets/ticks/Tstickdf<-rbind(
data.frame(x=(1:(ncol(recoded_data)-1))-taglen ) %>% mutate(y=x+taglen, xend=x+.7, yend=y),
data.frame(y=2:ncol(recoded_data) ) %>% mutate(x=y, yend=y-.5, xend=y)
)
# this only would work well for right-justified labels; the nudge_x gives the spaces for the ticks
ggcorr(recoded_data, hjust=1, size=4, color="grey50", geom="circle", nudge_x=-.5) +
geom_segment(data=tickdf, aes(x=x+1, y=y, xend=xend+1, yend=yend ))
... versus either of these (hjust of 1 and 0, respectively)
Would having ticks in ggcorr plots help anyone else? With short names the plots are easy to read, but with longer names I find it difficult. I'm happy to try to submit a PR if there is interest. This is how I've been adding them manually
... versus either of these (
hjust
of 1 and 0, respectively)The text was updated successfully, but these errors were encountered: