-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[MRG+1] plot_date() after axhline() doesn't rescale axes #8205
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
Changes from 6 commits
f758834
24b21ae
45eadc1
7eceed5
52beee2
a3dbc3c
b37ffc5
e083a81
ad03e22
4fa59c6
4e516f2
8c9ef18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4972,3 +4972,21 @@ def test_bar_single_height(): | |
ax.bar(range(4), 1) | ||
# Check that a horizontal chart with one width works | ||
ax.bar(0, 1, bottom=range(4), width=1, orientation='horizontal') | ||
|
||
def test_datetime_axhline_same_axes(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pep8 checker is probably going to want 2 blank lines between functions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like you'll also need to trim trailing whitespace: |
||
# This test was suggested by Paul Hobson (@phobson) regarding issue 7742 | ||
# Check when ploting datetime data and horizontal line < 571F /span> | ||
# order of plotting doesn't matter. | ||
# axhline() should not change x axis limits. | ||
from datetime import datetime | ||
fig, axs = plt.subplots(2, 1) | ||
xvalues = [datetime(2016, 1, 1, 0, 0, 0), datetime(2016, 1, 2, 0, 0, 0)] | ||
yvalues = [1, 2] | ||
|
||
axs[0].plot(xvalues, yvalues) | ||
axs[0].axhline(1.5) | ||
|
||
axs[1].axhline(1.5) | ||
axs[1].plot(xvalues, yvalues) | ||
|
||
assert (axs[0].get_xlim() == axs[1].get_xlim()) |
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.
Can you add a symmetric change to
axvline
?Uh oh!
There was an error while loading. Please reload this page.
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 have made a similar change to
axvline
. Please see my comment below before approving the changes.