Tag: ggplot2

59 votes
13 answers
1.9K views
How to change legend title in ggplot

I have the following plot like below. It was created with this command: library(ggplot2) df <- data.fram

avatar
Boyd
0 1 0 9
asked 07 September, 2021
52 votes
2 answers
1.9K views
How to set limits for axes in ggplot2 R plots?

I plot the following: library(ggplot2) carrots <- data.frame(length = rnorm(500000, 10000, 10000)) cu

avatar
Roger
0 1 0 9
asked 07 September, 2021
57 votes
13 answers
1.9K views
Side-by-side plots with ggplot2

I would like to place two plots side by side using the ggplot2 package, i.e. do the equivalent of par(mfrow=c(

avatar
Omar
0 1 0 9
asked 07 September, 2021
57 votes
16 answers
2.3K views
Plot two graphs in same plot in R

I would like to plot y1 and y2 in the same plot. x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x

avatar
Lynette
0 1 0 9
asked 07 September, 2021
62 votes
7 answers
2.4K views
How can we make xkcd style graphs?

Apparently, folk have figured out how to make xkcd style graphs in Mathematica and in LaTeX. Can we do it in R

avatar
Thurman
0 1 0 9
asked 07 September, 2021
47 votes
8 answers
776 views
Rotating and spacing axis labels in ggplot2

I have a plot where the x-axis is a factor whose labels are long. While probably not an ideal visualization,

avatar
Rufus
0 1 0 9
asked 07 September, 2021