Skip to content

Commit 2597bc9

Browse files
author
Marc Garcia
committed
Fixing bug with matplotlib 2
1 parent 9b4fc6d commit 2597bc9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/plotting/_matplotlib/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import matplotlib.pyplot as plt
2-
31
from pandas._config import get_option
42

53
from pandas.plotting._matplotlib.boxplot import (
@@ -31,6 +29,10 @@
3129

3230

3331
def plot(data, kind, **kwargs):
32+
# Importing pyplot at the top of the file (before the converters are
33+
# registered) causes problems in matplotlib 2 (converters seem to not
34+
# work)
35+
import matplotlib.pyplot as plt
3436
if kwargs.pop('reuse_plot', False):
3537
ax = kwargs.get('ax')
3638
if ax is None and len(plt.get_fignums()) > 0:

0 commit comments

Comments
 (0)