Search Results

Search found 1 results on 1 pages for 'user1162769'.

Page 1/1 | 1 

  • ggplot2 add legend for each geom_point manually

    - by user1162769
    I created a plot using 2 separate data sets so that I could create different errorbars. The first data set has error bars that go down only whereas the second data set has error bars that go up only. This prevents unnecessary overlap in the plot. I also used a compound shape for one of the groups. I want to create a legend based on these shapes (not a colour), but I can't seem to figure it out. Here is the plot code. p<-ggplot() p + geom_point(data=df.figure.1a, aes(x=Hour, y=Mean), shape=5, size=4) + geom_point(data=df.figure.1a, aes(x=Hour, y=Mean), shape=18, size=3) + geom_errorbar(data=df.figure.1a, aes(x=Hour, y=Mean, ymin = Mean - SD, ymax = Mean), size=0.7, width = 0.4) + geom_point(data=df.figure.1b, aes(x=Hour, y=Mean), shape=17, size=4) + geom_errorbar(data=df.figure.1b, aes(x=Hour, y=Mean, ymin = Mean, ymax = Mean + SD), size=0.7, width = 0.4)

    Read the article

1