Skip to content

Bars are not visible in bar plot when log scale is enabled #9701

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

Closed
laborleben opened this issue Nov 6, 2017 · 1 comment
Closed

Bars are not visible in bar plot when log scale is enabled #9701

laborleben opened this issue Nov 6, 2017 · 1 comment

Comments

@laborleben
Copy link

When enabling log scale for the bar plot, the bars are not plotted properly and the plot is empty.

See also this bug report #163 and the corresponding fix #2147.

Commit dda42ab changed the default value of nonpos parameter from clip to mask which introduced the issue. I cannot tell whether clip should be default behavior or mask doesn't work as intended.

import matplotlib.pyplot as plt
plt.bar(x=[1,2,3], height=[1000,2,3])
plt.yscale("log")
plt.show()

Result is an empty plot. Saving to an image file or PDF doesn't make a change.

Adding

plt.yscale("log", nonposy="clip")

fixes that issue.

Additional info:
Latest Miniconda
Various platforms (Ubuntu 16.04, Windows 10, macOS)
Matplotlib 2.1.0, Qt5Agg (from Anaconda)

@afvincent
Copy link
Contributor

Thank you for the nice report.

If I am correct this is a duplicate of #9288 and #9628, and the issue was fixed by #9477. Your MWE is working fine with Matplotlib from the current master branch and will be OK with Matplotlib 2.1.1, which should be shipped in aa very near future :).

Closing, but feel free to reopen if you think I was mistaken.

@tacaswell tacaswell added this to the v2.1.1 milestone Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants