@@ -750,6 +750,25 @@ def r(h):
750
750
ax .grid ()
751
751
return ax
752
752
753
+ def _mplplot_plotf (errorbar = False ):
754
+ import matplotlib .pyplot as plt
755
+ def plotf (ax , x , y , style = None , ** kwds ):
756
+ mask = com .isnull (y )
757
+ if mask .any ():
758
+ y = np .ma .array (y )
759
+ y = np .ma .masked_where (mask , y )
760
+
761
+ if errorbar :
762
+ return plt .Axes .errorbar (ax , x , y , ** kwds )
763
+ else :
764
+ # prevent style kwarg from going to errorbar, where it is unsupported
765
+ if style is not None :
766
+ args = (ax , x , y , style )
767
+ else :
768
+ args = (ax , x , y )
769
+ return plt .Axes .plot (* args , ** kwds )
770
+
771
+ return plotf
753
772
754
773
class MPLPlot (object ):
755
774
"""
@@ -1187,22 +1206,8 @@ def _get_plot_function(self):
1187
1206
the presence of errorbar keywords.
1188
1207
'''
1189
1208
errorbar = any (e is not None for e in self .errors .values ())
1190
- def plotf (ax , x , y , style = None , ** kwds ):
1191
- mask = com .isnull (y )
1192
- if mask .any ():
1193
- y = np .ma .array (y )
1194
- y = np .ma .masked_where (mask , y )
1195
-
1196
- if errorbar :
1197
- return self .plt .Axes .errorbar (ax , x , y , ** kwds )
1198
- else :
1199
- # prevent style kwarg from going to errorbar, where it is unsupported
1200
- if style is not None :
1201
- args = (ax , x , y , style )
1202
- else :
1203
- args = (ax , x , y )
1204
- return self .plt .Axes .plot (* args , ** kwds )
1205
- return plotf
1209
+
1210
+ return _mplplot_plotf (errorbar )
1206
1211
1207
1212
def _get_index_name (self ):
1208
1213
if isinstance (self .data .index , MultiIndex ):
0 commit comments