I'd like to define a theme for ggplot2 so that the default colour of geom_bar() is not black.
How can I do this?
you can't do it in a theme (sadly).
You want to change the default settings of a geom,
update_geom_defaults("bar", list(fill = "red"))
and you can also change a default scale, e.g.
scale_colour_continuous <- function(...)
scale_colour_gradient(low = "blue", high = "red", na.value="grey50", ...)
Theme controls apperance of non-data elements, so you need to work with scale
functions.
Try scale_fill_brewer
, e.g.:
scale_fill_brewer(palette = "Set1")
For details on this function see here.