Skip to content

Commit 876450c

Browse files
xinrong-mengzhengruifeng
authored andcommitted
[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 <xinrong@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
1 parent 08675b1 commit 876450c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6785,6 +6785,9 @@ def plot(self) -> "PySparkPlotAccessor":
67856785
Notes
67866786
-----
67876787
This API is experimental.
6788+
It provides two ways to create plots:
6789+
1. Chaining style (e.g., `df.plot.line(...)`).
6790+
2. Explicit style (e.g., `df.plot(kind="line", ...)`).
67886791
67896792
Examples
67906793
--------
@@ -6794,6 +6797,7 @@ def plot(self) -> "PySparkPlotAccessor":
67946797
>>> type(df.plot)
67956798
<class 'pyspark.sql.plot.core.PySparkPlotAccessor'>
67966799
>>> df.plot.line(x="category", y=["int_val", "float_val"]) # doctest: +SKIP
6800+
>>> df.plot(kind="line", x="category", y=["int_val", "float_val"]) # doctest: +SKIP
67976801
"""
67986802
...
67996803

0 commit comments

Comments
 (0)