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

Skip to content

FIX: numpy arrays are not 'truthy' #8025

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 1 commit into from
Feb 6, 2017
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
2 changes: 1 addition & 1 deletion lib/matplotlib/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def set_default_locators_and_formatters(self, axis):
axis.set_minor_locator(LogLocator(self.base, self.subs))
axis.set_minor_formatter(
LogFormatterSciNotation(self.base,
labelOnlyBase=bool(self.subs)))
labelOnlyBase=(self.subs is not None)))

def get_transform(self):
"""
Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ def test_log_scatter():
fig.savefig(buf, format='svg')


@cleanup
def test_logscale_subs():
fig, ax = plt.subplots()
ax.set_yscale('log', subsy=np.array([2, 3, 4]))
# force draw
fig.canvas.draw()


if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)