I have a line plot of prices for three stocks, which I normalise by taking the percentage change from the beginning of the period I am looking at. This seems to work fine, b
You can define new geom like this:
GeomLine2 <- proto(GeomLine, {
objname <- "line2"
guide_geom <- function(.) "polygon"
default_aes <- function(.) aes(colour = "black", size=0.5, linetype=1, alpha = 1, fill = "grey20")
})
geom_line2 <- GeomLine2$build_accessor()
chart1 <- ggplot(data=changes,aes(x=Date, y=value, colour=variable, fill = variable))
chart1 <- chart1 + geom_line2(lwd=0.5) + ylab("Change in price (%)") + xlab("Date") +
labs(colour="Company", fill = "Company")
print(chart1)
Not sure but note that this will not work in the next version of ggplot2.