0

I have multiple plots and I would like to display them all in a single graph. And I would like to make the dots for each graph a different color.

The code for each looks like this:

g6p <- ggplot(g6, aes(g6$greater6, g6$greater6.1), xlim = c(-100,100), ylim=c(-100,100))
g6p + geom_point() + coord_cartesian(xlim = c(-100, 100), ylim = c(-100, 100), expand = FALSE)


ts <- read.csv("",stringsAsFactors=F, header=T)
s30 <- data.frame(x=((ts+3000)* 5 / 24 / 60 * 2 * pi *cos((ts + 3000) * 5 / 24 / 60 * 2 * pi)), y=((ts + 3000)* 5 / 24 / 60 * 2 * pi *sin((ts + 3000) * 5 / 24 / 60 * 2 * pi)))
s30p <- ggplot(s30, aes(s30$thirty, s30$thirty.1), xlim = c(-100,100), ylim=c(-100,100))
s30p + geom_point() + coord_cartesian(xlim = c(-100, 100), ylim = c(-100, 100), expand = FALSE) + ggtitle("Event: Steps > 30") + labs(x="", y="")


ts <- read.csv("",stringsAsFactors=F, header=T)
s40 <- data.frame(x=((ts+3000)* 5 / 24 / 60 * 2 * pi *cos((ts + 3000) * 5 / 24 / 60 * 2 * pi)), y=((ts + 3000)* 5 / 24 / 60 * 2 * pi *sin((ts + 3000) * 5 / 24 / 60 * 2 * pi)))
s40p <- ggplot(s40, aes(s40$fourty, s40$fourty.1), xlim = c(-100,100), ylim=c(-100,100))
s40p + geom_point() + coord_cartesian(xlim = c(-100, 100), ylim = c(-100, 100), expand = FALSE) + ggtitle("Event: Steps > 40") + labs(x="", y="")

`

Please help,

aosmith
  • 34,856
  • 9
  • 84
  • 118
devakotia
  • 101
  • 1
  • 11
  • 1
    Have you tried anything yet for getting your plots into one plot and setting colors. If so, please add the attempts. One option is to stack your data.frames together, adding a grouping variable that you could use to color by. The other option is to use a new dataset in a new `geom_point` layer, manually setting the colors. – aosmith Sep 02 '16 at 13:27
  • 1
    One of several possible duplicates: http://stackoverflow.com/questions/19921842/plotting-multiple-time-series-on-the-same-plot-using-ggplot – aosmith Sep 02 '16 at 13:29

0 Answers0