-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
hline at y=0 appears after setting yscale to log #8783
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
Comments
On the other hand, you asked it to draw a line at 0 a it made a best-effort to do so. What does a line at a negative position do? |
Do nothing, which is what happens when the call to scatter is not included. |
Trying a line at a negative position ( Changing the code to import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.scatter([1], [1])
plt.semilogy()
ax.axhline(0)
plt.show() ignores the hline completely, and just shows the single scatter point as it was before. In my opinion I think this should be the behavior of `ax.set_yscale('log') too. At the very least they should be consistent which I think is what #8537 is for. |
Fixed by #8836 |
Bug report
Bug summary
Calling
ax.axhline(0)
after setting the y-scale to log rescales the y-axis to make the horizontal line appear at 1e-300.Code for reproduction
Actual outcome
with the warning
Expected outcome
I would expect the horizontal line to be ignored, and axis limits to remain as they were originally.
Matplotlib version
The text was updated successfully, but these errors were encountered: