Skip to content

Make set_yscale("log") consistent with semilogy() #8537

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
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Next Next commit
Fixed Axes.set_yscale and Axes.set_xscale so it has the same default
 clipping behavior as plt.semilogy(), plt.semilogx() plt.loglog()
when handing non-positive data.
  • Loading branch information
emmyzero authored and dstansby committed Apr 26, 2017
commit 0b18f8f24419ebaba7df7363df36a6fde78f1b78
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ def set_xscale(self, value, **kwargs):
# If the scale is being set to log, clip nonposx to prevent headaches
# around zero
if value.lower() == 'log' and 'nonposx' not in kwargs:
kwargs['nonposx'] = 'clip'
kwargs['nonposx'] = 'mask'

g = self.get_shared_x_axes()
for ax in g.get_siblings(self):
Expand Down Expand Up @@ -3277,7 +3277,7 @@ def set_yscale(self, value, **kwargs):
# If the scale is being set to log, clip nonposy to prevent headaches
# around zero
if value.lower() == 'log' and 'nonposy' not in kwargs:
kwargs['nonposy'] = 'clip'
kwargs['nonposy'] = 'mask'

g = self.get_shared_y_axes()
for ax in g.get_siblings(self):
Expand Down