Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9c031b9

Browse filesBrowse files
authored
Merge pull request #8025 from tacaswell/fix_log_subs
FIX: numpy arrays are not 'truthy'
2 parents 493cb8a + 3ae2ec9 commit 9c031b9
Copy full SHA for 9c031b9

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed

‎lib/matplotlib/scale.py

Copy file name to clipboardExpand all lines: lib/matplotlib/scale.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def set_default_locators_and_formatters(self, axis):
251251
axis.set_minor_locator(LogLocator(self.base, self.subs))
252252
axis.set_minor_formatter(
253253
LogFormatterSciNotation(self.base,
254-
labelOnlyBase=bool(self.subs)))
254+
labelOnlyBase=(self.subs is not None)))
255255

256256
def get_transform(self):
257257
"""

‎lib/matplotlib/tests/test_scale.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_scale.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ def test_log_scatter():
4848
fig.savefig(buf, format='svg')
4949

5050

51+
@cleanup
52+
def test_logscale_subs():
53+
fig, ax = plt.subplots()
54+
ax.set_yscale('log', subsy=np.array([2, 3, 4]))
55+
# force draw
56+
fig.canvas.draw()
57+
58+
5159
if __name__ == '__main__':
5260
import nose
5361
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.