Basics: Using R statistical software, ggplot2, geom_vline and geom_histogram to visualize some data. The problem is with the legend keys.
I am trying to build a pair of histograms from some stochastic simulations, and on top of this graph a couple of lines representing the result of deterministic modeling. I have data plotted, but the legend keys for histograms have an excess black line across the middle. Can you help me remove these black lines? The following is sample code that reproduces the problem:
df1 <- data.frame(cond = factor( rep(c("A","B"), each=200) ), rating = c(rnorm(200),rnorm(200, mean=.8))) df2 <- data.frame(x=c(.5,1),cond=factor(c("A","B"))) ggplot(df1, aes(x=rating, fill=cond)) + geom_histogram(binwidth=.5, position="dodge") + geom_vline(data=df2,aes(xintercept=x,linetype=factor(cond)), show_guide=TRUE) + labs(fill='Stochastic',linetype='Deterministic')
Edit: image added
Cheers, Ryan
source share