I have the following code:
import pptx
from pptx.util import Cm
from pptx.enum.chart import XL_CHART_TYPE
from pptx.chart.data import ChartData
from random import randrange
## Select path from which the deck will be imported
path_import = r"XXX.pptx"
## Select layout
SLD_LAYOUT_TITLE_AND_CONTENT = 6 #Empty template
## Create presentation
prs = pptx.Presentation(path_import)
slide_layout = prs.slide_layouts[SLD_LAYOUT_TITLE_AND_CONTENT]
slide = prs.slides.add_slide(slide_layout)
## Create chart data
chart_data1 = ChartData()
chart_data1.categories = [f"TM {i}" for i in range(1,21)]
chart_data1.add_series('Series 1', [randrange(10) for x in range(20)])
## Add chart
chart1 = slide.shapes.add_chart(chart_type=XL_CHART_TYPE.COLUMN_CLUSTERED,
x=Cm(0.75),
y=Cm(4.71),
cx=Cm(32.12),
cy=Cm(1.76),
chart_data=chart_data1)
## Save deck to path
path_export = r"YYY.pptx"
prs.save(path_export)
So I now have a slide with a graph on it, the "chart area" dimensions are 32.12 cm long and 1.76 cm wide. However, the "plot area" dimensions are fairly small comparatively and I'd like to increase them so that they take up a bigger proportion of the graph. I can't find any reference to this in the documentation, is this possible?