Skip to content

Conversation

@xinrong-meng
Copy link
Member

@xinrong-meng xinrong-meng commented Sep 19, 2024

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.

>>> 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)

plot2
Figure_1

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.

@xinrong-meng xinrong-meng changed the title [SPARK-49716][PS] Imrpove documentation and test of barh plot [SPARK-49716][PS] Fix documentation and test of barh plot Sep 19, 2024
@xinrong-meng xinrong-meng changed the title [SPARK-49716][PS] Fix documentation and test of barh plot [SPARK-49716][PS] Fix documentation and add test of barh plot Sep 19, 2024
@xinrong-meng xinrong-meng changed the title [SPARK-49716][PS] Fix documentation and add test of barh plot [SPARK-49716][PS][DOCS] Fix documentation and add test of barh plot Sep 19, 2024
@dongjoon-hyun dongjoon-hyun changed the title [SPARK-49716][PS][DOCS] Fix documentation and add test of barh plot [SPARK-49716][PS][DOCS][TESTS] Fix documentation and add test of barh plot Sep 19, 2024
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @xinrong-meng .
Merged to master.

@xinrong-meng
Copy link
Member Author

Thank you @dongjoon-hyun !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants