python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Change points color in scatter plot

Open LogOpsBolivar01 opened this issue 3 years ago • 2 comments

I am trying to change color in scatter plot as it can be done in other charts:

chart_data = pptx.chart.data.XyChartData()

series_1 = chart_data.add_series('A') series_1.add_data_point(0.7, 2.7) series_1.add_data_point(1.8, 3.2) series_1.add_data_point(2.6, 0.8)

series_2 = chart_data.add_series('B') series_2.add_data_point(1.3, 3.7) series_2.add_data_point(2.7, 2.3) series_2.add_data_point(1.6, 1.8)

chart = slide.shapes.add_chart( XL_CHART_TYPE.XY_SCATTER, Inches(0.1), Inches(0.3), Inches(4), Inches(4), chart_data ).chart

for point in chart.series[0].points: fill = point.format.fill #fill the legend as well fill.solid() fill.fore_color.rgb = RGBColor.from_string('016D38')

But, instead of colouring the points, it draws a line:

image

¿How can I change the color of the points?

LogOpsBolivar01 avatar Jul 07 '22 12:07 LogOpsBolivar01

I got the same problem, haven't found out how to color them yet

TokeyChan avatar Apr 16 '23 07:04 TokeyChan

Unfortunately, I have not found a solution.

LogOpsBolivar01 avatar Apr 16 '23 20:04 LogOpsBolivar01