Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

581
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda