Closed pascaloettli closed 8 months ago
ggplot2 3.5.0
breaks the function. It works as expected with ggplot2 3.4.4
guide_colorsteps()
is a ggplot2 function. The changes in the guide system seem to have messed it up somehow. Here's an pure ggplot2 example:
library(ggplot2)
levels <- pretty(range(volcano))
volcano2 <- reshape2::melt(volcano) |>
transform(value_discrete = cut(value,
breaks = levels,
ordered_result = TRUE))
ggplot(volcano2, aes(Var1, Var2)) +
geom_raster(aes(fill = value_discrete))
ggplot(volcano2, aes(Var1, Var2)) +
geom_raster(aes(fill = value_discrete)) +
guides(fill = guide_colorsteps())
Created on 2024-03-20 with reprex v2.0.2
I opened an issue on their repo, which you can follow here: https://github.com/tidyverse/ggplot2/issues/5786
BTW, this has been fixed in the development version of ggplot2
Sorry, I missed the fact is was a ggplot2 function and not a metR function. Sorry for the annoyance
Trying to reproduce the example of discretised_scale(), it fails to produce the correct result:
ggplot2_3.5.0 metR_0.15.0