Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Last active December 30, 2015 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChimeraCoder/7865598 to your computer and use it in GitHub Desktop.
Save ChimeraCoder/7865598 to your computer and use it in GitHub Desktop.
> p <- ggplot(data=masterdata8, aes(certainty, nanoseconds, colour="red")) +
> geom_point() +
> geom_point(data=masterdata4, colour="blue") +
> geom_point(data=masterdata1, colour="green")
> head(masterdata8)
certainty benchmark iterations nanoseconds
1 10 BenchmarkSafePrimes-8 10 13465462805
2 11 BenchmarkSafePrimes-8 10 14741964114
3 12 BenchmarkSafePrimes-8 10 16018608344
4 13 BenchmarkSafePrimes-8 5 14646835899
5 14 BenchmarkSafePrimes-8 5 15734636602
6 15 BenchmarkSafePrimes-8 5 16736838514
@thomaskern
Copy link

f = function(df,name){df$mycolor = name;df}
df2 = rbind(f(masterdata8,"Monday"),f(masterdata4,"Tuesday"),f(masterdata1,"Blah"))
ggplot(df2,aes(certainty,nanoseconds,color=mycolor)) + geom_point()

@jsonbecker
Copy link

You could also try this:

masterdata <- rbind(masterdata1, masterdata4, masterdata8)
p <- ggplot(data=masterdata, aes(certainty, nanoseconds, color=benchmark)) +
       geom_point() +
       scale_colour_manual(values = c('red', 'blue', 'green'), breaks=...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment