3 added 1132 characters in body edited Jun 20 '12 at 9:59 cbeleites 25.7k254105 large clusters: if overprinting is a problem, you could either use a lower alpha, so single points are dim, but overprining makes more intense colour. Or you switch to 2d histograms or density estimates. require ("ggplot2") ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, colour = Species)) + stat_density2d () You'd probably want to facet this... ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, fill = Species)) + stat_binhex (bins=5, aes (alpha = ..count..)) + facet_grid (. ~ Species) While you can procude this plot also without facets, the prining order of the Species influnces the final picture. You can avoid this if you're willing to get your hands a bit dirty (= link to explanation & code) and calculate mixed colours for the hexagons: Another useful thing is to use (hex)bins for high density areas, and plot single points for other parts: ggplot (df, aes (x = date, y = t5)) + stat_binhex (data = df [df$$t5 <= 0.5,], bins = nrow (df) / 250) + geom_point (data = df [df$$t5 > 0.5,], aes (col = type), shape = 3) + scale_fill_gradient (low = "#AAAAFF", high = "#000080") + scale_colour_manual ("response type", values = c (normal = "black", timeout = "red")) + ylab ("t / s")   For the sake of completeness of the plotting packages, let me also mention lattice: require ("lattice") xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) large clusters: if overprinting is a problem, you could either use a lower alpha, so single points are dim, but overprining makes more intense colour. Or you switch to 2d histograms or density estimates. require ("ggplot2") ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, colour = Species)) + stat_density2d () You'd probably want to facet this... ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, fill = Species)) + stat_binhex (bins=5, aes (alpha = ..count..)) + facet_grid (. ~ Species) While you can procude this plot also without facets, the prining order of the Species influnces the final picture. You can avoid this if you're willing to get your hands a bit dirty (= link to explanation & code) and calculate mixed colours for the hexagons: For the sake of completeness, let me also mention lattice: require ("lattice") xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) large clusters: if overprinting is a problem, you could either use a lower alpha, so single points are dim, but overprining makes more intense colour. Or you switch to 2d histograms or density estimates. require ("ggplot2") ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, colour = Species)) + stat_density2d () You'd probably want to facet this... ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, fill = Species)) + stat_binhex (bins=5, aes (alpha = ..count..)) + facet_grid (. ~ Species) While you can procude this plot also without facets, the prining order of the Species influnces the final picture. You can avoid this if you're willing to get your hands a bit dirty (= link to explanation & code) and calculate mixed colours for the hexagons: Another useful thing is to use (hex)bins for high density areas, and plot single points for other parts: ggplot (df, aes (x = date, y = t5)) + stat_binhex (data = df [df$$t5 <= 0.5,], bins = nrow (df) / 250) + geom_point (data = df [df$$t5 > 0.5,], aes (col = type), shape = 3) + scale_fill_gradient (low = "#AAAAFF", high = "#000080") + scale_colour_manual ("response type", values = c (normal = "black", timeout = "red")) + ylab ("t / s")   For the sake of completeness of the plotting packages, let me also mention lattice: require ("lattice") xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) 2 added 1132 characters in body edited Jun 20 '12 at 9:44 cbeleites 25.7k254105 large clusters: if overprinting is a problem, you could either use a lower alpha, so single points are dim, but overprining makes more intense colour. Or you switch to 2d histograms or density estimates. require ("ggplot2") ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, colour = Species)) + stat_density2d () You'd probably want to facet this... ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, fill = Species)) + stat_binhex (bins=5, aes (alpha = ..count..)) + facet_grid (. ~ Species) While you can procude this plot also without facets, the prining order of the Species influnces the final picture. You can avoid this if you're willing to get your hands a bit dirty (= link to explanation & code) and calculate mixed colours for the hexagons: For the sake of completeness, let me add the lattice versionalso mention lattice:  require ("lattice") xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) For the sake of completeness, let me add the lattice version: xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) large clusters: if overprinting is a problem, you could either use a lower alpha, so single points are dim, but overprining makes more intense colour. Or you switch to 2d histograms or density estimates. require ("ggplot2") ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, colour = Species)) + stat_density2d () You'd probably want to facet this... ggplot (iris, aes (x = Sepal.Length, y = Sepal.Width, fill = Species)) + stat_binhex (bins=5, aes (alpha = ..count..)) + facet_grid (. ~ Species) While you can procude this plot also without facets, the prining order of the Species influnces the final picture. You can avoid this if you're willing to get your hands a bit dirty (= link to explanation & code) and calculate mixed colours for the hexagons: For the sake of completeness, let me also mention lattice:  require ("lattice") xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20) 1 answered Jun 20 '12 at 9:09 cbeleites 25.7k254105 For the sake of completeness, let me add the lattice version: xyplot(Sepal.Width ~ Sepal.Length | Species, iris, pch= 20) xyplot(Sepal.Width ~ Sepal.Length, iris, groups = iris$Species, pch= 20) xyplot(Sepal.Width ~ Sepal.Length | Species, iris, groups = iris$Species, pch= 20)