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

Skip to content

Commit 102b4a5

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.0.x'
Conflicts: doc/users/plotting/colormaps/lightness.py - keep master version which uses new api
2 parents f273178 + e9ab1cf commit 102b4a5

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

doc/users/plotting/colormaps/lightness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# squeeze=False to handle similarly the case of a single subplot
4242
fig, axes = plt.subplots(nrows=nsubplots, squeeze=False,
43-
figsize=(7, 2.6*nsubplots))
43+
figsize=(7, 2.6*nsubplots))
4444

4545
for i, ax in enumerate(axes.flat):
4646

555 Bytes
Loading

lib/matplotlib/ticker.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,8 +2112,6 @@ def tick_values(self, vmin, vmax):
21122112
return np.array([]) # no minor or major ticks
21132113
else:
21142114
subs = np.array([1.0]) # major ticks
2115-
elif numdec > 5 and b >= 6:
2116-
subs = np.arange(_first, b, 2.0)
21172115
else:
21182116
subs = np.arange(_first, b)
21192117
else:
@@ -2129,17 +2127,25 @@ def tick_values(self, vmin, vmax):
21292127
while numdec // stride + 1 > numticks:
21302128
stride += 1
21312129

2130+
# Does subs include anything other than 1?
2131+
have_subs = len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0)
2132+
21322133
decades = np.arange(math.floor(vmin) - stride,
21332134
math.ceil(vmax) + 2 * stride, stride)
2135+
21342136
if hasattr(self, '_transform'):
21352137
ticklocs = self._transform.inverted().transform(decades)
2136-
if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0):
2137-
ticklocs = np.ravel(np.outer(subs, ticklocs))
2138+
if have_subs:
2139+
if stride == 1:
2140+
ticklocs = np.ravel(np.outer(subs, ticklocs))
2141+
else:
2142+
ticklocs = []
21382143
else:
2139-
if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0):
2144+
if have_subs:
21402145
ticklocs = []
2141-
for decadeStart in b ** decades:
2142-
ticklocs.extend(subs * decadeStart)
2146+
if stride == 1:
2147+
for decadeStart in b ** decades:
2148+
ticklocs.extend(subs * decadeStart)
21432149
else:
21442150
ticklocs = b ** decades
21452151

0 commit comments

Comments
 (0)