Skip to content

Commit 5f8b0a4

Browse files
Merge branch 'master' of github.com:matplotlib/mplfinance
2 parents 504f03b + d59f6cd commit 5f8b0a4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/mplfinance/_mplwraps.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import matplotlib.pyplot as plt
22
import matplotlib.figure as mplfigure
3+
import matplotlib.axes as mpl_axes
34
from mplfinance import _styles
5+
import numpy as np
46

57
"""
68
This file contains:
@@ -102,12 +104,18 @@ def subplots(self,*args,**kwargs):
102104

103105
if 'style' in kwargs or not hasattr(self,'mpfstyle'):
104106
style = _check_for_and_apply_style(kwargs)
107+
self.mpfstyle = style
105108
else:
106109
style = _check_for_and_apply_style(dict(style=self.mpfstyle))
107110

108111
axlist = mplfigure.Figure.subplots(self,*args,**kwargs)
109-
110-
self.mpfstyle = style
111-
if ax in axlist:
112-
ax.mpfstyle = style
113-
return fig, axlist
112+
113+
if isinstance(axlist,mpl_axes.Axes):
114+
axlist.mpfstyle = style
115+
elif isinstance(axlist,np.ndarray):
116+
for ax in axlist.flatten():
117+
ax.mpfstyle = style
118+
else:
119+
raise TypeError('Unexpected type ('+str(type(axlist))+') '+
120+
'returned from "matplotlib.figure.Figure.subplots()"')
121+
return axlist

src/mplfinance/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
version_info = (0, 12, 7, 'alpha', 1)
2+
version_info = (0, 12, 7, 'alpha', 2)
33

44
_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}
55

0 commit comments

Comments
 (0)