Skip to content

Backport PR #26126 on branch v3.7.x (Revert "Merge pull request #24555 from parthpankajtiwary/symlog-warn") #26216

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/matplotlib/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ def __init__(self, base, linthresh, linscale):

def transform_non_affine(self, a):
abs_a = np.abs(a)
if (abs_a < self.linthresh).all():
_api.warn_external(
"All values for SymLogScale are below linthresh, making "
"it effectively linear. You likely should lower the value "
"of linthresh. ")
with np.errstate(divide="ignore", invalid="ignore"):
out = np.sign(a) * self.linthresh * (
np.power(self.base,
Expand Down
14 changes: 0 additions & 14 deletions lib/matplotlib/tests/test_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ def test_symlog_mask_nan():
assert type(out) == type(x)


def test_symlog_linthresh():
np.random.seed(19680801)
x = np.random.random(100)
y = np.random.random(100)

fig, ax = plt.subplots()
plt.plot(x, y, 'o')
ax.set_xscale('symlog')
ax.set_yscale('symlog')

with pytest.warns(UserWarning, match="All values .* of linthresh"):
fig.canvas.draw()


@image_comparison(['logit_scales.png'], remove_text=True)
def test_logit_scales():
fig, ax = plt.subplots()
Expand Down