Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Python: maximum displayable points on chart

Hey guys!

 

I have created a scatter plot that has the date on the X-axis and various values on the Y-axis (Columns: maxCurrentCutter & maxCurrentNormal — see screenshot). Since I wanted a slicer for differentiation, I transformed the table into a Unipivot table. However, when I want to visualize this, only the data points from 2020 to 2022 are visible on the visual, not 2020-2024. I'll show you a screenshot with the original table (maxCurrentCutter & Normal as two separate columns) and one with the Unipivot table.

 

In the Unipivot table, there are naturally twice as many rows as in the original table (about 250K vs. 125K), and even when I filter the Unipivot visualization so that about 140K data points are again present, it works as usual. But the original Visual has also 250K values and there it works to show all the data.

 

Therefore, my question is: Is there a maximum number of displayable points in Python visuals, or why else are not all datasets displayed?

That doesn't make any sense to me 

 

--------------------------------------------------------------------------------------------

Unipivot-visualisation:

dominicghr_0-1713167429859.png

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates

# Datetype of 'Date'
dataset['Date'] = pd.to_datetime(dataset['startDate'])

# Define colors based on the 'Attribute' column.
colors = np.where(dataset['Attribute'] == 'maxCurrentCutter', 'green', 'orange')  # 'green' is for cutter, 'orange' is for normal

#Plot
plt.scatter(dataset['Date'], dataset['Value'], s=10, c = colors)

plt.title('Max Thread Cut Current')
plt.xlabel('DateTime')
plt.ylabel('[Ampere]]')
plt.grid(True)

# vertical Grid
#plt.gca().xaxis.grid(False)
plt.xticks(rotation=30)
plt.tight_layout()
plt.legend(handles=[matplotlib.patches.Patch(color='green', label='maxCurrentCutter'),
                    matplotlib.patches.Patch(color='orange', label='maxCurrentNormal')],
           loc='upper left')

plt.show()

 

Original visual:

dominicghr_1-1713167785083.png

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Datetype of 'Date'
dataset['Date'] = pd.to_datetime(dataset['startDate'])

# Plot  
plt.scatter(dataset['Date'], dataset['maxCurrentCutter'], color='green', s=10, label='maxCurrentCutter')
plt.scatter(dataset['Date'], dataset['maxCurrentNormal'], color='orange', s=10, label='maxCurrentNormal')


plt.title('Max Thread Cut Current')
plt.xlabel('Date')
plt.ylabel('[Ampere]]')
plt.grid(True)
# vertical Grid
#plt.gca().xaxis.grid(False)
plt.xticks(rotation=30)
plt.tight_layout()
plt.legend(loc='upper left')

plt.show()

 

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous ,

 

This does not match what the official documentation says, my guess is that the Unipivot table has an increased amount of data and therefore only shows the first part of the data.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

The solution is simple: The data the Python visual uses for plotting is limited to 150,000 rows. If more than 150,000 rows are selected, only the top 150,000 rows are used, and a message appears on the image. The input data also has a limit of 250 MB.

More for this: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals#limitations

 

Hope it helps somebody

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

The solution is simple: The data the Python visual uses for plotting is limited to 150,000 rows. If more than 150,000 rows are selected, only the top 150,000 rows are used, and a message appears on the image. The input data also has a limit of 250 MB.

More for this: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals#limitations

 

Hope it helps somebody

Anonymous
Not applicable

Hi @Anonymous ,

 

This does not match what the official documentation says, my guess is that the Unipivot table has an increased amount of data and therefore only shows the first part of the data.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.