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,

2
  • 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. Commented Sep 2, 2016 at 13:27
  • 1
    One of several possible duplicates: stackoverflow.com/questions/19921842/… Commented Sep 2, 2016 at 13:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.