You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a bug in the function geom_contour_filled where it fails in some simple cases.
library(tidyverse)
#Generate some datadata= crossing(x=1:10, y=1:10) %>%
mutate(z= (x+y)/4)
#Works great
ggplot(data) + geom_contour_filled(aes(x, y, z=z))
#Make a minor tweak and it failsdata2=data %>% mutate(z=z+100)
ggplot(data2) + geom_contour_filled(aes(x, y, z=z))
#> Warning: Computation failed in `stat_contour_filled()`:#> factor level [4] is duplicated
Looking into it, I believe the problem is with the legend names (more specifically the function pretty_isoband_levels). If the z values are close, you can get different levels with the same names because it only uses 3 digits (eg. "(101, 101]" and again "(101, 101]").