GGally - unexpected behavior with ggpairs(…, diag = list( continuous = 'density'))

前端 未结 1 1952
一整个雨季
一整个雨季 2021-02-06 00:02

I am trying to generate a scatterplot matrix with density plots in the diagonals (using ggplot, preferably). The documentation for ggpairs in the GGally package sta

相关标签:
1条回答
  • 2021-02-06 00:31

    So I finally figured this out, by studying a different question here. It turns out that unless axisLabels is set to "show", density plots on the diagonal are suppressed, without warning.

    xx <- mtcars[,c(1,3,4,6)]   ## extract mpg, disp, hp, and wt from mtcars
    library(GGally)
    ggpairs(xx, diag=list(continuous="density"), axisLabels='show')
    

    Produces this, as expected:

    0 讨论(0)
提交回复
热议问题