Skip to content

fix for issue #5201, empty extension triangle for vmin < 1.0 #5319

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
fix for issue #5201, added test case
  • Loading branch information
arjenve committed Oct 26, 2015
commit 345dad1b8ef39ebeb76ce339e5a05c1dbe38d18b
13 changes: 12 additions & 1 deletion lib/matplotlib/tests/test_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.colors import BoundaryNorm
from matplotlib.colors import LogNorm
from matplotlib.cm import get_cmap
from matplotlib import cm
from matplotlib.colorbar import ColorbarBase
from nose.tools import assert_greater_equal


def _get_cmap_norms():
Expand Down Expand Up @@ -254,7 +256,16 @@ def test_colorbarbase():
ax = plt.gca()
ColorbarBase(ax, plt.cm.bone)


@cleanup
def test_colorbar_lognorm_extension():
# Issue #5201: empty triangle plotted
# for logarithmic colorbar with vmin < 1.0
ax = plt.gca()

cb = ColorbarBase(ax, norm=LogNorm(vmin=1, vmax=1000.0), orientation='vertical', extend='both')

assert_greater_equal(cb._values[0], 0.0)

@image_comparison(
baseline_images=['colorbar_closed_patch'],
remove_text=True)
Expand Down