Skip to content

Instantly share code, notes, and snippets.

@vfulco
Forked from baptiste/chernofftable.R
Created December 30, 2017 08:18
Show Gist options
  • Save vfulco/9f00af4550670b01b65570d8947e7459 to your computer and use it in GitHub Desktop.
Save vfulco/9f00af4550670b01b65570d8947e7459 to your computer and use it in GitHub Desktop.
library(jsonlite)
library(ggplot2)
library(ggChernoff)
# https://github.com/Bowserinator/Periodic-Table-JSON
d <- jsonlite::fromJSON('PeriodicTableJSON.json')[["elements"]]
ggplot(d, aes(xpos,10-ypos)) +
geom_chernoff(aes(fill=category, size = phase, smile = density, brow = molar_heat)) +
geom_text(aes(label=symbol), vjust=2.5) +
guides(fill=guide_legend(ncol=2)) +
theme_void() +
scale_brow_continuous(breaks = c(10, 25, 50))+
theme(legend.position = 'right', panel.background = element_rect(colour="black"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment