Hello team!
I've been trying to create plots in combination with gghighlight to indicate results that are above average for the dataset (multiple of these will be combined with so it's useful for audiences to focus only on the highlighted results)
It happens that the highlighted result generated by gghighlight has a different amount of columns (showing 2 bars only i/o 5) do you guys (maybe @yutannihilation) know what might be causing that?
#Example Data Frame
library(tidyverse)
states = c("KY","OH","TN","VA","WV")
rate = c(0.174,0.191,0.277,0.192,0.292)
df <- data.frame(states,rate)
#Create avg for gghighlight
avg_rate = mean(rate)
ggplot(
data = df,
aes(x = states, y = rate)) +
geom_col() +
gghighlight::gghighlight(rate > avg_rate)
Oh, I can reproduce it with the CRAN version of ggplot2. It seems it's something unintentionally introduced in v3.4.0 (no problem with v3.3.6), which is already fixed in the GitHub version. So, it seems there's nothing I can do, sorry. Thanks @nirgrahamuk for the workaround!