hughjonesd / ggmagnify

Create a magnified inset of part of a ggplot object

Home Page:https://hughjonesd.github.io/ggmagnify/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

an issue with `shape = "ellipse"`

Syutenjyo opened this issue · comments

when i draw an ellipse annotation in geom_magnify, it just worked wrong

ggplot(diamonds[diamonds$carat>1.2,], aes(carat, depth, color = cut)) + 
  geom_point() + 
  geom_magnify(from=c(1.8,63,2.2,67),to=c(3.6,48,6,58),shadow = T,shape = "ellipse") +
  coord_cartesian(clip = "off") + 
  theme(legend.position = c(1.15,.75),plot.margin = margin(20,90,10,10))

image
the annotation still looks like a rectangle thogth circled in an ellipse ┗( T﹏T )┛

You need to use a device which supports masks, also R 4.2 or higher.

thanks, when i export as a pdf file, the ellipse annotation works.