Highlight geoms in ggplot2.
Suppose we have a data that has so many series that it is hard to identify them by their colours as the differences are so subtle.
gghighlight(), we can highlight the lines whose max values are larger than 20:
library(gghighlight) p <- ggplot(d) + geom_line(aes(idx, value, colour = type)) + gghighlight(max(value) > 19) #> label_key: type p
The result is a usual ggplot object, so it is fully customizable. For example, it can be used with custom themes and facets.
p + theme_minimal()