zhengruifeng opened a new pull request, #48164:
URL: https://github.com/apache/spark/pull/48164

   ### What changes were proposed in this pull request?
   Switch `Scatter` plot to sampled data
   
   
   ### Why are the changes needed?
   when the data distribution has relationship with the order, the first n rows 
will not be representative of the whole dataset
   
   for example:
   ```
   import pandas as pd
   import numpy as np
   import pyspark.pandas as ps
   
   # ps.set_option("plotting.max_rows", 10000)
   np.random.seed(123)
   
   pdf = pd.DataFrame(np.random.randn(10000, 4), 
columns=list('ABCD')).sort_values("A")
   psdf = ps.DataFrame(pdf)
   
   psdf.plot.scatter(x='B', y='A')
   ```
   
   all datapoints:
   
![image](https://github.com/user-attachments/assets/72cf7e97-ad10-41e0-a8a6-351747d5285f)
   
   before (first 1k datapoints):
   
![image](https://github.com/user-attachments/assets/1ed50d2c-7772-4579-a84c-6062542d9367)
   
   after (sampled 1k datapoints):
   
![image](https://github.com/user-attachments/assets/6c684cba-4119-4c38-8228-2bedcdeb9e59)
   
   
   ### Does this PR introduce _any_ user-facing change?
   yes
   
   
   
   ### How was this patch tested?
   ci and manually test
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to