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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
niyati_61
Helper III
Helper III

python visual: Scatter Plot 2 sets of data points

Hello,

 

I used a Python Visual to make the Scatter Plot Chart below, however the X-Axis is not visible? 

The X-Axis has a lot of Date Time Data (Eg: 2021-10-04 07:57:40). However it is just showing as a blank black line.

Black Points Marked (Measured) 

 

Also, how do I add another set of data points to this graph? Red Points (For Simulation) But that will be against another X and Y axis. I require it in the same scatter plot chart.

niyati_61_0-1636819446500.png

 

Thank you!

2 REPLIES 2
niyati_61
Helper III
Helper III

Hi @YukiK ,

Thanks for replying, appreciate it!
Actually the color of the data points is not the issue here. And yes, I did try streching the visual to its max size, and I used the formula too however my x-axis is not visible still. 

 

Okay, let me explain exactly what I require. 

Currently I'm working with CSV data, 2 Files as shown below, 

Measured Data

niyati_61_1-1636802085547.png

 

Simulation Data

niyati_61_2-1636802141060.png

 

I want to make a scatter plot chart using a python visual. 

Imp Note: The measured CSV File has around 8k rows,

and the simulation CSV File has around 1.5k rows.

 

They are not plotted against the same exact times. The reason why Simulation has less points is that, once the Measured is marked on the chart, the simulation data points cover from the beginning to the end like overall.

 

So bascially for both of these, we need to use all the 4 axes.

 

This is what I finally want, 

niyati_61_0-1636802933987.png

 

I tried it in Power BI, I can get the Measured points in one chart (Like I have shown here), and similarly Simulation points in another chart. 

But, how do I combine the 2 together in one chart like this one?

 

Kindly require your assistance asap. Thank you in advance!

YukiK
Impactful Individual
Impactful Individual

I'm guessing the issue is in your Python code. You can specify color like this (if using matplotlib):

 

plt.scatter(x, y, color = 'hotpink')

 

As far as the x-axis goes, I think the size of the visual is simply small for the number of values that need to be shown. So if just making the visual bigger in Power BI doesn't work, try have it wider in matplotlib like this:

 

figure(figsize=(20, 8))

 

Let me know if this helps!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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