xinrong-meng opened a new pull request, #48139:
URL: https://github.com/apache/spark/pull/48139

   ### What changes were proposed in this pull request?
   Support line plot with plotly backend on both Spark Connect and Spark 
classic.
   
   ### Why are the changes needed?
   While Pandas on Spark supports plotting, PySpark currently lacks this 
feature. The proposed API will enable users to generate visualizations, such as 
line plots, by leveraging libraries like Plotly. This will provide users with 
an intuitive, interactive way to explore and understand large datasets directly 
from PySpark DataFrames, streamlining the data analysis workflow in distributed 
environments.
   
   See more at [PySpark Plotting API 
Specification](https://docs.google.com/document/d/1IjOEzC8zcetG86WDvqkereQPj_NGLNW7Bdu910g30Dg/edit?usp=sharing)
 in progress.
   
   Part of https://issues.apache.org/jira/browse/SPARK-49530.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes.
   
   ```python
   >>> data = [("A", 10, 1.5), ("B", 30, 2.5), ("C", 20, 3.5)]
   >>> columns = ["category", "int_val", "float_val"]
   >>> sdf = spark.createDataFrame(data, columns)
   >>> sdf.show()
   +--------+-------+---------+                                                 
   
   |category|int_val|float_val|
   +--------+-------+---------+
   |       A|     10|      1.5|
   |       B|     30|      2.5|
   |       C|     20|      3.5|
   +--------+-------+---------+
   
   >>> f = sdf.plot(kind="line", x="category", y="int_val")
   >>> f.show()  # see below
   >>> g = sdf.plot.line(x="category", y=["int_val", "float_val"])
   >>> g.show()  # see below
   ```
   `f.show()`:
   
![newplot](https://github.com/user-attachments/assets/ebd50bbc-0dd1-437f-ae0c-0b4de8f3c722)
   
   `g.show()`:
   ![newplot 
(1)](https://github.com/user-attachments/assets/46d28840-a147-428f-8d88-d424aa76ad06)
   
   
   ### How was this patch tested?
   Unit tests.
   
   ### 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