Skip to content

Commit

Permalink
Merge remote-tracking branch 'matplotlib/v2.0.x'
Browse files Browse the repository at this point in the history
Conflicts:
    doc/users/plotting/colormaps/lightness.py
       - keep master version which uses new api
  • Loading branch information
tacaswell committed Apr 9, 2017
2 parents f273178 + e9ab1cf commit 102b4a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/users/plotting/colormaps/lightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

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

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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2112,8 +2112,6 @@ def tick_values(self, vmin, vmax):
return np.array([]) # no minor or major ticks
else:
subs = np.array([1.0]) # major ticks
elif numdec > 5 and b >= 6:
subs = np.arange(_first, b, 2.0)
else:
subs = np.arange(_first, b)
else:
Expand All @@ -2129,17 +2127,25 @@ def tick_values(self, vmin, vmax):
while numdec // stride + 1 > numticks:
stride += 1

# Does subs include anything other than 1?
have_subs = len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0)

decades = np.arange(math.floor(vmin) - stride,
math.ceil(vmax) + 2 * stride, stride)

if hasattr(self, '_transform'):
ticklocs = self._transform.inverted().transform(decades)
if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0):
ticklocs = np.ravel(np.outer(subs, ticklocs))
if have_subs:
if stride == 1:
ticklocs = np.ravel(np.outer(subs, ticklocs))
else:
ticklocs = []
else:
if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0):
if have_subs:
ticklocs = []
for decadeStart in b ** decades:
ticklocs.extend(subs * decadeStart)
if stride == 1:
for decadeStart in b ** decades:
ticklocs.extend(subs * decadeStart)
else:
ticklocs = b ** decades

Expand Down

0 comments on commit 102b4a5

Please sign in to comment.