Skip to content

Instantly share code, notes, and snippets.

//simplest making pointplot
ggplot(m,ase(x=ocean,y=mortality)) + geom_point()
//divide into color on barchart = geom_histogram(aes(fill=...))
g + geom_histogram(alpha=0.5, aes(fill=ocean))
//making bubble chart. circle= data of size.
symbols(teamvelocity$TotalPoints, teamvelocity$TotalDevs, circles=teamvelocity$Team, inches=0.35, fg="#00FFFF", ylab="Team Members", xlab="velocity", bg="#CCCCCC")
//show stacked two charts at the same time. layout() is the frame.
layout(matrix(1:2, nrow = 2))
par(mar = par("mar") * c(0.8,1,1,1))
boxplot(m$mortality, ylim=xr, horizontal = TRUE, xlab="mortality")
hist(m$mortality, ylit=xr)
//以下に永続的に値を適用する=par

Based on http://bl.ocks.org/mbostock/899711 which uses D3 to draw elements into a google maps overlay layer, but doesn't use d3.geo machinery to draw map geometry. This gist illustrates how to align a D3 mercator projection with google maps so we can do standard d3 mapping stuff on top of the google API.