search for: ungridded

Displaying 1 result from an estimated 1 matches for "ungridded".

Did you mean: gridded
2008 Mar 04
1
ggplot2 - Problem with grid plot
...to create a grid plot in which each plot in the grid contains two density plots (colored by factor) and two vertical lines at the respective medians (also colored by the factor). Using the diamonds dataset as an example, the following commands give me price density plots by factor cut in a single, ungridded plot. p <- ggplot(data=diamonds, aes(x=price)) + geom_density(aes(color=cut)) p I can add vertical lines at the medians of each density as follows. medians <- data.frame(cut=levels(diamonds$cut), intercept=tapply(diamonds$price, list(diamonds$cut), median)) p + geom_vline(data=medians, ae...