Skip to content

Commit 1a24bb8

Browse files
xinrong-mengyhuang-db
authored andcommitted
[SPARK-52169][PYTHON][DOCS] User guide for native plotting
### What changes were proposed in this pull request? User guide for native plotting ### Why are the changes needed? Guide users to use PySpark native plotting ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual rendering. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#50992 from xinrong-meng/usr_guide_plot. Lead-authored-by: Xinrong Meng <xinrong@apache.org> Co-authored-by: Xinrong Meng <xinrong.apache@gmail.com> Signed-off-by: Xinrong Meng <xinrong@apache.org>
1 parent f77e70d commit 1a24bb8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

python/docs/source/user_guide/dataframes.ipynb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,25 @@
751751
"source": [
752752
"df.write().mode(\"overwrite\").saveAsTable(\"schemaName.tableName\")"
753753
]
754+
},
755+
{
756+
"cell_type": "markdown",
757+
"metadata": {},
758+
"source": [
759+
"## Native DataFrame Plotting\n",
760+
"\n",
761+
"PySpark supports native plotting, allowing users to visualize data directly from PySpark DataFrames.\n",
762+
"\n",
763+
"The user interacts with PySpark Plotting by calling the `plot` property on a PySpark DataFrame and specifying the desired type of plot, either as a submethod or by setting the `kind` parameter. For instance:\n",
764+
"\n",
765+
"`df.plot.line(x=\"category\", y=\"int_val\")`\n",
766+
"\n",
767+
"or equivalently:\n",
768+
"\n",
769+
"`df.plot(kind=\"line\", x=\"category\", y=\"int_val\")`\n",
770+
"\n",
771+
"The feature is powered by [Plotly](https://plotly.com/python/) as the default visualization backend, offering rich, interactive plotting capabilities, while native [pandas](https://pandas.pydata.org/) is used internally to process data for most plots.\n"
772+
]
754773
}
755774
],
756775
"metadata": {

0 commit comments

Comments
 (0)