# Creating scatter plot in excel

**URL:** <https://forum.codewithmosh.com/t/creating-scatter-plot-in-excel/20827>\
**Category:** Python\
**Created:** [June 15, 2023, 10:08am UTC](https://forum.codewithmosh.com/t/creating-scatter-plot-in-excel/20827 "2023-06-15T10:08:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_lake](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@Simon\_lake](https://forum.codewithmosh.com/u/Simon_lake)\
**Post date:** [June 15, 2023, 10:08am UTC](https://forum.codewithmosh.com/t/creating-scatter-plot-in-excel/20827/1 "2023-06-15T10:08:17Z")

</div>

I am trying to create the automated scatter plot in excel using python based on Mosh’s code in his tutorials. It code runs with no errors but when I open the excel file it has not produced a scatter plot. Any help would be appreciated. Below is my code: I have two columns of data with 5839 rows.

import openpyxl as xl  
from openpyxl.chart import scatter\_chart, Reference

def process\_workbook(yield\_cwp):  
wb = xl.load\_workbook(yield\_cwp)  
sheet = wb[“Sheet1”]

```
Values = Reference(sheet,
                   min_row=2,
                   max_row=5839,
                   min_col=1,
                   max_col=2)
chart = scatter_chart()
chart.add_data(Values)
sheet.add_chart(chart, "e2")

wb.save(yield_cwp)

```
