Skip to content

Can't edit text when saving a plotnine figure to an svg file #756

@nettanetta

Description

@nettanetta

Hi,
First I want to thank you for helping me avoid writing code in R, Plotnine is a lifesaver package!
Lately, I noticed that when I save a plot made with R's ggplot2 as an SVG or PDF file, I can upload it to illustrator and edit the figure text. However, when I do the same with a plot generated using plotnine, illustrator does not recognize the text as text and therefore makes editing my figures a bit tricky.

As an example I created the same figure using ggplot and plotnine (based on this tutorial).

Is it possible to fix it?
thanks!
Netta

python code:

from plotnine import *
from palmerpenguins import load_penguins

penguins = load_penguins().dropna()
p = ggplot(penguins, aes(x = "island")) + geom_bar()
ggsave(p, filename = "penguins_python.svg")

R code:

library(ggplot2)
library(palmerpenguins)

penguins <- na.omit(palmerpenguins::penguins)
penguins_figure <- ggplot(penguins, aes(x = island)) + geom_bar()
ggsave(penguins_figure, filename = "penguins-figure.svg")


penguins_python
penguins_r

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions