While trying to get the answer to this question the obvious way, I ran into a rather unexpected error. I tried to set the option axis.line
in the theme using the function opts()
, tried to update it using theme_update()
, but all to no avail. Each time when I tried it, I got the same error :
Error in validDetails.polyline(x) : It is invalid to specify both 'id' and 'id.lengths'
Some example code giving this error:
require(ggplot2)
Data <- data.frame(autos=c(
sample(1:4,8,TRUE),
sample(6:9,4,TRUE),
11,18
))
ggplot(Data,aes(autos)) +
geom_histogram(fill='lightblue',colour="black",binwidth=5) +
opts(axis.line=theme_line(), panel.border=theme_blank())
Any idea what I am overlooking?