Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Raise an error or a warning when ylim's min == 0 and yscale == "log" #7299

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
NelleV opened this issue Oct 17, 2016 · 2 comments
Closed

Raise an error or a warning when ylim's min == 0 and yscale == "log" #7299

NelleV opened this issue Oct 17, 2016 · 2 comments
Labels
Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

Comments

@NelleV
Copy link
Member

NelleV commented Oct 17, 2016

import matplotlib.pyplot as plt
import numpy as np

y = np.arange(3000, 112471, 10000)

fig, ax = plt.subplots()
ax.set_yscale("log")
ax.plot(y, linewidth=0, marker=".")
ax.set_ylim((0, 1e5))

yields:

figure_2

Basically, the ymin gets ignored (sometimes) when ymin == 0 and yscale == 0.

The code should raise an error or at least a warning.

version: 2.0.0b4.post2455+g063cd41

@NelleV NelleV added the Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues label Oct 17, 2016
cfackler added a commit to cfackler/matplotlib that referenced this issue Oct 31, 2016
An attempt to call set_xlim() or set_ylim() with non-positive limits
on a log-scale axis will produce a warning.
NelleV added a commit that referenced this issue Oct 31, 2016
Warn on invalid log axis limits, per issue #7299
bcongdon pushed a commit to bcongdon/matplotlib that referenced this issue Nov 8, 2016
An attempt to call set_xlim() or set_ylim() with non-positive limits
on a log-scale axis will produce a warning.
bcongdon pushed a commit to bcongdon/matplotlib that referenced this issue Nov 8, 2016
An attempt to call set_xlim() or set_ylim() with non-positive limits
on a log-scale axis will produce a warning.
@dstansby
Copy link
Member

dstansby commented Jan 5, 2017

Looks like this is fixed now.

@efiring
Copy link
Member

efiring commented Jan 6, 2017

Right, it is fixed in master.

@efiring efiring closed this as completed Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Easy https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Projects
None yet
Development

No branches or pull requests

3 participants