Skip to content

Instantly share code, notes, and snippets.

@dlebauer
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save dlebauer/7cf1d8727cf8e501b03e to your computer and use it in GitHub Desktop.

Select an option

Save dlebauer/7cf1d8727cf8e501b03e to your computer and use it in GitHub Desktop.
library(PEcAn.DB)
library(ggplot2)
dbparms <- list(driver = "PostgreSQL", dbname = "bety", user = "bety", host = "localhost", password = "bety")
con <- db.open(dbparms)
views <- db.query("select * from traits_and_yields_view_private", con = con)
db.close(con)
world <- map_data("world")
ggplot() +
geom_jitter(data = views,
aes(lon, lat), alpha = 0.1, position = position_jitter(width = 1, height = 1)) +
geom_polygon(data = world, aes(long, lat, group = group), color = "grey80", alpha = 0) +
theme_bw() + scale_color_brewer(palette="Dark2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment