Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 92766bb

Browse filesBrowse files
committed
Merge pull request #2428 from cpelley/symlognorm_fix
BUG: Fixed object type missmatch in SymLogNorm
2 parents 6fc76e3 + d3dba08 commit 92766bb
Copy full SHA for 92766bb

File tree

Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def __init__(self, linthresh, linscale=1.0,
10551055
the logarithmic range. Defaults to 1.
10561056
"""
10571057
Normalize.__init__(self, vmin, vmax, clip)
1058-
self.linthresh = linthresh
1058+
self.linthresh = float(linthresh)
10591059
self._linscale_adj = (linscale / (1.0 - np.e ** -1))
10601060

10611061
def __call__(self, value, clip=None):
@@ -1113,7 +1113,7 @@ def _transform_vmin_vmax(self):
11131113
Calculates vmin and vmax in the transformed system.
11141114
"""
11151115
vmin, vmax = self.vmin, self.vmax
1116-
arr = np.array([vmax, vmin])
1116+
arr = np.array([vmax, vmin]).astype(np.float)
11171117
self._upper, self._lower = self._transform(arr)
11181118

11191119
def inverse(self, value):

‎lib/matplotlib/tests/test_colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colors.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ def test_SymLogNorm():
7676
_scalar_tester(norm, vals)
7777
_mask_tester(norm, vals)
7878

79+
# Ensure that specifying vmin returns the same result as above
80+
norm = mcolors.SymLogNorm(3, vmin=-30, vmax=5, linscale=1.2)
81+
normed_vals = norm(vals)
82+
assert_array_almost_equal(normed_vals, expected)
83+
7984

8085
def _inverse_tester(norm_instance, vals):
8186
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.