I made a scattermatrix with the ggplot2 extension GGally with the following code
ggscatmat(dat2, columns = 2:6, color="car", alpha=0.8) +
ggtitle("Korrelation") +
theme(axis.text.x = element_text(angle=-40, vjust=1, hjust=0, size=10))
Now my problem is that in this case I don't really need the density lineplot or the correlation coeff., I do only want the scatterplots in the matrix. Is there a way to "delete" the other facets? I can#T find anything in the documentation.
Please excuse my bad english and thanks for any advice or help!
Edit: I found a not yet perfect solution with ggpairs:
ggpairs(dat2, columns = 2:6, mapping= aes(color=car),
upper = "blank",diag = "blank") +
theme(axis.text.x = element_text(angle=-40, vjust=1, hjust=0, size=10))
But now there's no legend anymore and two labels looking like the plot hasn't fully loaded yet:
Following the official documentation, you can set an element of the
ggpairs
to blank. In your case you would be interested in changing the value for the diag todiag = "blank"
, as shown in the example below.Example
On example of the mtcars data, you could do the following:
Results
The code would produce the desired chart without the diagonal plot:
You can manually remove parts of the plot by messing about with the
gtable