Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

572
Views
Editable plots in PowerPoint from python: equivalent of officer and rvg

I am using the officer and rvg packages to get plots from R into MS PowerPoint as editable vector graphics. Reproducible example below.

I am looking for a way to implement an equivalent solution with python, preferably using matplotlib. The critical part is not the creation of slides from the IDE but rather the editable vector graphics part, i.e. plots should end up in PowerPoint as grouped objects comprised of a range of simple powerpoint geometries such as lines, squares, and text fields.

R example:

library(tidyverse)
library(officer)
library(rvg)

# Get some data and make a plot
ggp <- diamonds %>% 
  group_by(clarity) %>%
  summarise(price = mean(price)) %>%
  ggplot(aes(x = clarity, y = price, fill = clarity)) +
  geom_bar(stat = 'identity', colour = 'black')

# Create a new powerpoint document
doc <- read_pptx()
doc <- add_slide(doc, 'Title and Content', 'Office Theme')
# Add the plot 
doc <- ph_with_vg(doc, ggobj = ggp, type = 'body')  

# Write the document to a file
print(doc, target = 'plots.pptx')

The resulting chart is completely editable:

enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Since the 2019 version of MS office you can add svg files as images and then ungroup them to make them editable. See 'Convert an SVG image to an Office shape' on this MS page. In my personal experience, this is however neither very stable nor complete.

Another way, which is more stable and complete although still not perfect, is importing it in powerpoint as emf file, which is also a vector-format. Old version of matplotlib could export to this format. For newer version, I export as svg and then use inkscape --file "input.svg" --export-emf "output.emf" to convert to emf, which I then load in powerpoint. Ungrouping the object again allows you to edit, if everything works well.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!