Skip to content

Commit

Permalink
Handle mpl33 deprecations (#2199)
Browse files Browse the repository at this point in the history
Co-authored-by: Maoz Gelbart <13831112+MaozGelbart@users.noreply.github.com>
  • Loading branch information
mwaskom and MaozGelbart committed Aug 18, 2020
1 parent c517470 commit a31f100
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion seaborn/_core.py
Expand Up @@ -5,6 +5,7 @@
from collections.abc import Iterable, Sequence, Mapping
from numbers import Number
from datetime import datetime
from distutils.version import LooseVersion

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -1106,7 +1107,10 @@ def _attach(self, obj, allowed_types=None, log_scale=None):
if scale is True:
set_scale("log")
else:
set_scale("log", **{f"base{axis}": scale})
if LooseVersion(mpl.__version__) >= "3.3":
set_scale("log", base=scale)
else:
set_scale("log", **{f"base{axis}": scale})

def _log_scaled(self, axis):
"""Return True if specified axis is log scaled on all attached axes."""
Expand Down
9 changes: 7 additions & 2 deletions seaborn/matrix.py
Expand Up @@ -298,9 +298,14 @@ def plot(self, ax, cax, kws):
# Remove all the Axes spines
despine(ax=ax, left=True, bottom=True)

# setting vmin/vmax in addition to norm is deprecated
# so avoid setting if norm is set
if "norm" not in kws:
kws.setdefault("vmin", self.vmin)
kws.setdefault("vmax", self.vmax)

# Draw the heatmap
mesh = ax.pcolormesh(self.plot_data, vmin=self.vmin, vmax=self.vmax,
cmap=self.cmap, **kws)
mesh = ax.pcolormesh(self.plot_data, cmap=self.cmap, **kws)

# Set the axis limits
ax.set(xlim=(0, self.data.shape[1]), ylim=(0, self.data.shape[0]))
Expand Down

0 comments on commit a31f100

Please sign in to comment.