Open hughjonesd opened 1 year ago
The underlying reason is https://github.com/tidyverse/ggplot2/issues/5294: xmin
and xmax
get trashed by scale_x_binned
and friends.
geom_magnify2 is a workaround
Updated version where this still breaks:
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
scale_y_binned(n.breaks = 5) +
geom_magnify_tile(x = 15, width = 5, y = 200, height = 100, to_x = 30, to_y = 200, to_width = 5, to_height = 150)
or
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
scale_y_binned(n.breaks = 5) + geom_magnify(from = c(12.5, 150, 17.5, 250) , to = c(27.5,125, 32.5, 275))
Test case which works fine without the call to
scale
: