Skip to content

Instantly share code, notes, and snippets.

@muschellij2
Created February 18, 2016 20:03
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 muschellij2/709b08acbbb9b6c5a85f to your computer and use it in GitHub Desktop.
Save muschellij2/709b08acbbb9b6c5a85f to your computer and use it in GitHub Desktop.
## ----plot----------------------------------------------------------------
library(ggplot2)
ggplot(data = quakes, aes(x = lat,y = long,colour = stations)) + geom_point()
## ----save_plot-----------------------------------------------------------
g = ggplot(data = quakes,
aes(x = lat,y = long,colour = stations)) +
geom_point() +
xlab("Latitude") + ylab("Longitude") +
theme_bw() +
theme(axis.text = element_text(size = 18),
axis.title = element_text(size = 20),
legend.text = element_text(size = 15),
legend.title = element_text(size = 15),
legend.position = c(0.3, 0.35),
legend.background = element_rect(fill = "transparent"),
legend.key = element_rect(fill = "transparent",
color = "transparent")) +
guides(
colour = guide_colorbar(title = "Number\nof\nStations\nReporting",
title.hjust = 0.5,
title.position = "left"))
print(g)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment