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

Skip to content

Commit d2f4d30

Browse files
committed
Merge branch 'v1.5.x' into v2.x
2 parents 7488da6 + f19fea6 commit d2f4d30

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

doc/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def all():
165165
os.unlink(link)
166166
else:
167167
raise RuntimeError("doc/{0} should be a directory or symlink -- it"
168-
" isn't")
168+
" isn't".format(link))
169169
if not os.path.exists(link):
170170
if hasattr(os, 'symlink'):
171171
os.symlink(target, link)

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def _ticker(self):
580580
else:
581581
b = self._boundaries[self._inside]
582582
locator = ticker.FixedLocator(b, nbins=10)
583-
if isinstance(self.norm, colors.NoNorm):
583+
if isinstance(self.norm, colors.NoNorm) and self.boundaries is None:
584584
intv = self._values[0], self._values[-1]
585585
else:
586586
intv = self.vmin, self.vmax

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def __call__(self, x, pos=None):
707707
elif six.callable(fmt):
708708
result = fmt(x, pos)
709709
else:
710-
raise TypeError('Unexpected type passed to {!r}.'.formatter(self))
710+
raise TypeError('Unexpected type passed to {0!r}.'.format(self))
711711

712712
return result
713713

lib/matplotlib/tests/test_colorbar.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,22 @@ def test_colorbar_closed_patch():
282282
extend='neither', values=values)
283283

284284

285+
@cleanup
286+
def test_colorbar_ticks():
287+
# test fix for #5673
288+
fig, ax = plt.subplots()
289+
x = np.arange(-3.0, 4.001)
290+
y = np.arange(-4.0, 3.001)
291+
X, Y = np.meshgrid(x, y)
292+
Z = X * Y
293+
clevs = np.array([-12, -5, 0, 5, 12], dtype=float)
294+
colors = ['r', 'g', 'b', 'c']
295+
cs = ax.contourf(X, Y, Z, clevs, colors=colors)
296+
cbar = fig.colorbar(cs, ax=ax, extend='neither',
297+
orientation='horizontal', ticks=clevs)
298+
assert len(cbar.ax.xaxis.get_ticklocs()) == len(clevs)
299+
300+
285301
if __name__ == '__main__':
286302
import nose
287303
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)