yutannihilation / gghighlight

Highlight points and lines in ggplot2

Home Page:https://yutannihilation.github.io/gghighlight/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlight with expand_limits

jsta opened this issue · comments

I am trying to highlight given an expand_limits layer but it throws an error:

d <- data.frame(
  idx = c( 1, 1, 1, 2, 2, 2, 3, 3, 3),
  value = c( 1, 2, 3,10,11,12, 9,10,11),
  category = rep(c("a","b","c"), 3),
  stringsAsFactors = FALSE
)

ggplot(d, aes(idx, y = value, colour = category)) +
  geom_line() +
  expand_limits(x = 0) + 
  gghighlight(max(value) > 10)

Error in merge_mapping(layer, plot_mapping) :
No mapping found on this layer!

Is this a duplicate of #65?

This code seems to work with the Github version of gghighlight but not CRAN.

I don't remember when I fixed this... Anyway, thanks for reporting!