Closed soedr closed 7 years ago
scale_fill_fivethirtyeight
is only for discrete values, while scale_fill_viridis
is for continuous values. Even though you may be passing integers to the 538 scale, the vector is probably numeric so ggplot2 thinks it is continuous values. Either convert the vector to an integer using as.integer
or a factor, and perhaps explicitly set values of breaks
and labels
as described in discrete_scale().
Hi, thanks for the great package. Came across a
Error: Continuous value supplied to discrete scale
error when trying to usescale_fill_fivethirtyeight()
on a df with only string and integer values.scale_fill_viridis()
works like charm.