Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BUG: Handle overlapping line and bar on the same plot #61173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
BUG: Handle overlapping line and bar on the same plot #61173
Changes from 11 commits
3caf8e6
97d0440
5fb6172
ee183d7
e5b4e6f
c5a6554
218871d
16762b6
bb2fdd7
950441b
392d2b5
b28f9af
7a30ec7
8d8d17d
168b271
8ed678d
5cc8c28
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert
only uses the freq attribute of axis, so one should allow the user to pass freq without axis object.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fails on main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing
ax.get_xticks()
here have the same length ass
; why have[: len(s)]
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After plotting the line, the ticks change on my machine:
A fourth tick is added by matplotlib for '2026'.
Even for integer indices, matplotlib does not do a 1-to-1 mapping between each x-tick and data point, as attested below:
Not sure if you can reproduce those results on your machine, but I think that the exact number of ticks is irrelevant. I would suggest that this test checks that both x-tick labels (after bar plot and after line plot) include at least the 3 three ticks in the index (2023, 2024, 2025) and that the associated x-tick positions are the same for both plots. This would ensure that the two plots are superposed.
Additionally, the test can check that x-lim includes those three x-tick positions, which would ensure that the current plot view render the two plots.
I added a commit to reflect what I said above. Happy to discuss or update the code further if there is a need.