Export ggplot2 image with editable text

I would like to export images from ggplot2 where the text is editable. I have tried pdf and svg, but when editing them in a vector editing software, the text are shapes and not editable as text. Is there a better format, device or setting that can be changed to allow exporting editable text in images?

Looking into this a bit, I see that the problem is showtext package.

This creates editable text:

library(ggplot2)

p <- ggplot(iris,aes(Sepal.Length,Petal.Length))+
      geom_point()+
      geom_text(aes(label=Species))+
      labs(title="Iris dataset")+
      theme_bw()

ggsave("iris.pdf",p)

When using a custom font using showtext, fonts are converted to shapes.

library(showtext)

font_add_google("Lato")
showtext_auto()

p1 <- p+theme_bw(base_family = "Lato")
ggsave("iris-showtext.pdf",p1)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.