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

Skip to content

Commit 6a6bcb3

Browse files
NelleVQuLogic
authored andcommitted
Merge pull request #8367 from ColinDruery/master
symlog + minor ticks = exception
1 parent 64b9ece commit 6a6bcb3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3374,7 +3374,7 @@ def minorticks_on(self):
33743374
elif scale == 'symlog':
33753375
s = ax._scale
33763376
ax.set_minor_locator(
3377-
mticker.SymmetricalLogLocator(s.base, s.subs))
3377+
mticker.SymmetricalLogLocator(s._transform, s.subs))
33783378
else:
33793379
ax.set_minor_locator(mticker.AutoMinorLocator())
33803380

lib/matplotlib/tests/test_axes.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4861,6 +4861,18 @@ def test_eventplot_legend():
48614861
plt.legend()
48624862

48634863

4864+
# Test all 4 combinations of logs/symlogs for minorticks_on()
4865+
@cleanup
4866+
def test_minorticks_on():
4867+
for xscale in ['symlog', 'log']:
4868+
for yscale in ['symlog', 'log']:
4869+
fig, ax = plt.subplots()
4870+
ax.plot([1, 2, 3, 4])
4871+
ax.set_xscale(xscale)
4872+
ax.set_yscale(yscale)
4873+
ax.minorticks_on()
4874+
4875+
48644876
if __name__ == '__main__':
48654877
import nose
48664878
import sys

0 commit comments

Comments
 (0)