8000 BUG : fix #3805 by tacaswell · Pull Request #3808 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

BUG : fix #3805 #3808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,14 @@ def _process_values(self, b=None):
self._values = v
return
else:
self.norm.vmin, self.norm.vmax = mtrans.nonsingular(self.norm.vmin,
self.norm.vmax,
expander=0.1)
if not self.norm.scaled():
self.norm.vmin = 0
self.norm.vmax = 1

self.norm.vmin, self.norm.vmax = mtrans.nonsingular(self.norm.vmin,
self.norm.vmax,
expander=0.1)

b = self.norm.inverse(self._uniform_y(self.cmap.N + 1))
if self._extend_lower():
b[0] = b[0] - 1
Expand Down
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@ def test_remove_from_figure_no_gridspec():
_test_remove_from_figure(False)


@cleanup
def test_colorbarbase():
# smoke test from #3805
ax = plt.gca()
ColorbarBase(ax, plt.cm.bone)


if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
0