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

Saving ggmagnify plot with ggsave()

StefanosVoglis opened this issue · comments

Hello,
great package, thanks for your work!

Describe the bug
When I am trying to save one of the example plots with ggsave() to either pdf or eps format there seems to be an issue with the content of the magnified inset. It is just not displayed.

To Reproduce

ggpi <- ggplot(iris, aes(Sepal.Width, Sepal.Length, colour = Species)) +
    geom_point() + xlim(c(1.5, 6))

p <- ggpi + geom_magnify(aes(from = Species == "setosa" & Sepal.Length < 5), 
                    to = c(4, 6, 6, 7.5))

ggsave("filename.eps", p, device = cairo_pdf)

Screenshots
image

Other information

packageVersion("ggplot2")
[1] ‘3.4.4’
packageVersion("ggmagnify")
[1] ‘0.2.0.9000’

Thanks in advance.

If I replace "filename.eps" with "filename.pdf", I get the inset fine. (If I don't do that, my mac complains it doesn't know how to open the eps file.) Can you try this? If that doesn't work, what's your R version, platform, and output of capabilities()?

Closing, no response from submitter. Reopen if needed.