0

I am hoping to just change the diagonal plots to have simple outlines so I can view the overlap of the density functions more clearly but am not having much luck. Here is the code I have been using:

plot_rh <- ggpairs(data_rh[,1:6],  mapping = ggplot2::aes(color = Condition_name),
lower = list(combo = wrap(ggally_facethist, bins = 10)), 
diag = list(continuous = wrap("densityDiag"), mapping = ggplot2::aes(fill=Condition_name)))

Plot with filled density functions:

Plot with filled density functions

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • Sorry about that...this was my first time posting a question. Would this be more appropriate "How to specify unfilled lines using ggpairs?" – Taha Abdullah Apr 18 '17 at 18:58
  • What's lacking is the data to reproduce your problem. But in fact, the question could be closed as a duplicate: http://stackoverflow.com/questions/34727408/edit-individual-ggplots-in-ggallyggpairs-how-do-i-have-the-density-plot-not-f – neilfws Apr 18 '17 at 21:28

1 Answers1

1

Changing aes(fill=Condition_name) to aes(color=Condition_name) should result in unfilled lines.

You could also change it to aes(fill=Condition_name), alpha = 0.4 to make the filled densities semi-transparent which may improve the view.

neilfws
  • 32,751
  • 5
  • 50
  • 63
  • Hello, thanks for the reply, however, after changing 'fill' to 'color' it still is filled, but the alpha does improve viewing the density functions. – Taha Abdullah Apr 18 '17 at 19:02
  • Interesting; I had assumed that `aes()` would work as for `geom_density` but apparently not. Anyway: this question has been asked before and has an answer: http://stackoverflow.com/questions/34727408/edit-individual-ggplots-in-ggallyggpairs-how-do-i-have-the-density-plot-not-f – neilfws Apr 18 '17 at 21:26