When calling theme_tech: "plot.subtitle" is not a valid theme element name
Closed this issue · 4 comments
The example code fails with the following error:
library(ggtech)
d <- qplot(carat, data = diamonds[diamonds$color %in% LETTERS[4:7], ],
geom = "histogram", bins=30, fill = color)
d + theme_tech(theme="google") +
scale_fill_tech(theme="google") +
labs(title="Google theme",
subtitle="now with subtitles for ggplot2 >= 2.1.0")
Error in (function (el, elname) : "plot.subtitle" is not a valid theme element name.
scale_fill_tech
works on its own, so the issue concerns theme_tech
.
I'm fully up to date: R 3.3.0, ggtech_0.1, ggplot2_2.1.0
I had had same issue like you, but fortunately I found how to solve it :)
remove your ggplot2 package using "remove.packages("ggplot2")"
then install develop version of ggplot2 "devtools::install_github('hadley/ggplot2')"
I found only develop version has plot.subtitle element.
package ‘hadley/ggplot2’ is not available (for R version 3.3.2), ghost?
Got moved from hadley to tidyverse, so:
devtools::install_github('tidyverse/ggplot2')
But I think the CRAN version now has plot.subtitle
.
Having trouble checking as I'm on R 3.2.2 which ggtech doesn't work for (corporate installation so can't upgrade), but I suspect this issue is resolved by the ggplot2 update including plot.subtitle.