I'm creating a polar plot showing a histogram of the direction travlled of paired group data. More specifically, directions travelled between different groups of sibling.
Here is a mock:
mockdf <- data.frame(dir = as.numeric( runif( 1000, -pi/2, pi) ),
ID = sample(letters[1:2], 1000, TRUE))
ggplot(data=mockdf, aes(x=mockdf$dir)) +
coord_polar(theta = "x", start = pi, direction = 1) +
scale_fill_manual(name = "Sibling", values=c("black", "White")) +
geom_histogram(bins=32, aes(fill=mockdf$ID), color= "black") +
facet_wrap(~mockdf$ID) +
scale_y_continuous("Number of reloactions", limits = c(-8,30)) +
scale_x_continuous(limits = c(-pi,pi), breaks = c(0, pi/4, pi/2, 3*pi/4,
pi, -3*pi/4, -pi/2, -pi/4),
labels = c("N", "NE", "E", "SE", "S", "SW", "W", "NW"))
I'd like to move the y axis labels of 0, 10, 20, 30 onto the grid itself (i.e. along the SW orientation), but having difficulties doing so. Does anyone know how I go about doing this?