简体   繁体   中英

How to delete a plot from chart space in pptx python?

I'd like to delete plot that is in the chart space. Does any one know how to do that with pptx python? Since there's option to delete plots in powerpoint GUI. Is there any way I can do that with python pptx?

I have four charts in a slide and I want to first store the shapes of plots and then delete the plots inside of the charts.

Reading the docs I found this paragraph that shows in more detail how plots work:

A plot is like a sub-chart, containing one or more series and drawn as a particular chart type, like column or line. This distinction is needed for charts that combine more than one type, like a line chart appearing on top of a column chart. A chart like this would have two plot objects, one for the series appearing as columns and the other for the lines. Most charts only have a single plot and python-pptx doesn't yet support creating multi-plot charts, but you can access multiple plots on a chart that already has them.

From your question I assume that you want to delete the plot to replace it with a new one. I suggest that you delete the series inside the existing plot and add to it the new series you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM