Displaying 1 result from an estimated 1 matches for "scale_y_discr".
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
...39;))
mcsm <- melt(data.frame(date=economics$date, q=quarters(economics$date)),
id='date')
mcsm$value <- factor(mcsm$value)
ggplot(subm, aes(date, value, col=variable, group=1)) + geom_line() +
facet_grid(variable~., scale='free_y') + geom_step(data=mcsm, aes(date,
value)) + scale_y_discrete(breaks=levels(mcsm$value))
If I leave out scale_y_discrete, R complains that I'm trying to combine
discrete value with continuous scale. If I include scale_y_discreate my
continuous series miss their scale.
Is there any neat way of solving this issue ? I also see that the legend is
alphabe...