This is an automated email from the ASF dual-hosted git repository.

ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 876450c41300 [SPARK-50646][PYTHON][DOCS] Document explicit style of 
pyspark plotting
876450c41300 is described below

commit 876450c4130062a80f4ecb7b7afd232b5481a99f
Author: Xinrong Meng <[email protected]>
AuthorDate: Mon Dec 23 13:21:21 2024 +0800

    [SPARK-50646][PYTHON][DOCS] Document explicit style of pyspark plotting
    
    ### What changes were proposed in this pull request?
    Document explicit style of pyspark plotting.
    
    ### Why are the changes needed?
    To improve documentation by explicitly showing both chaining 
(df.plot.line(...)) and explicit (df.plot(kind="line", ...)) styles, ensuring 
clarity for users
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Existing tests.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #49265 from xinrong-meng/pyplot.
    
    Authored-by: Xinrong Meng <[email protected]>
    Signed-off-by: Ruifeng Zheng <[email protected]>
---
 python/pyspark/sql/dataframe.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index ccb9806cc76d..f88ca5348ff2 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -6785,6 +6785,9 @@ class DataFrame:
         Notes
         -----
         This API is experimental.
+        It provides two ways to create plots:
+        1. Chaining style (e.g., `df.plot.line(...)`).
+        2. Explicit style (e.g., `df.plot(kind="line", ...)`).
 
         Examples
         --------
@@ -6794,6 +6797,7 @@ class DataFrame:
         >>> type(df.plot)
         <class 'pyspark.sql.plot.core.PySparkPlotAccessor'>
         >>> df.plot.line(x="category", y=["int_val", "float_val"])  # doctest: 
+SKIP
+        >>> df.plot(kind="line", x="category", y=["int_val", "float_val"])  # 
doctest: +SKIP
         """
         ...
 


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

Reply via email to