Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49716][PS][DOCS][TESTS] Fix documentation and add test of barh…
… plot ### What changes were proposed in this pull request? - Update the documentation for barh plot to clarify the difference between axis interpretation in Plotly and Matplotlib. - Test multiple columns as value axis. The parameter difference is demonstrated as below. ```py >>> df = ps.DataFrame({'lab': ['A', 'B', 'C'], 'val': [10, 30, 20]}) >>> df.plot.barh(x='val', y='lab').show() # plot1 >>> ps.set_option('plotting.backend', 'matplotlib') >>> import matplotlib.pyplot as plt >>> df.plot.barh(x='lab', y='val') >>> plt.show() # plot2 ``` plot1 ![newplot (5)](https://github.com/user-attachments/assets/f1b6fabe-9509-41bb-8cfb-0733f65f1643) plot2 ![Figure_1](https://github.com/user-attachments/assets/10e1b65f-6116-4490-9956-29e1fbf0c053) ### Why are the changes needed? The barh plot’s x and y axis behavior differs between Plotly and Matplotlib, which may confuse users. The updated documentation and tests help ensure clarity and prevent misinterpretation. ### Does this PR introduce _any_ user-facing change? No. Doc change only. ### How was this patch tested? Unit tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48161 from xinrong-meng/ps_barh. Authored-by: Xinrong Meng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information