@@ -1170,17 +1170,22 @@ def _make_plot(self):
11701170 else :
11711171 args = (ax , x , y , style )
11721172
1173- newline = plotf (* args , ** kwds )[0 ]
1174- lines .append (newline )
1175- leg_label = label
1176- if self .mark_right and self .on_right (i ):
1177- leg_label += ' (right)'
1178- labels .append (leg_label )
1179- ax .grid (self .grid )
1180-
1181- if self ._is_datetype ():
1182- left , right = _get_xlim (lines )
1183- ax .set_xlim (left , right )
1173+ try :
1174+ newline = plotf (* args , ** kwds )[0 ]
1175+ lines .append (newline )
1176+ leg_label = label
1177+ if self .mark_right and self .on_right (i ):
1178+ leg_label += ' (right)'
1179+ labels .append (leg_label )
1180+ ax .grid (self .grid )
1181+
1182+ if self ._is_datetype ():
1183+ left , right = _get_xlim (lines )
1184+ ax .set_xlim (left , right )
1185+ except AttributeError as inst : # non-numeric
1186+ msg = ('Unable to plot data %s vs index %s,\n '
1187+ 'error was: %s' % (str (y ), str (x ), str (inst )))
1188+ print msg
11841189
11851190 self ._make_legend (lines , labels )
11861191
@@ -1198,19 +1203,27 @@ def to_leg_label(label, i):
11981203 return label + ' (right)'
11991204 return label
12001205
1206+ def _plot (data , col_num , ax , label , style , ** kwds ):
1207+ try :
1208+ newlines = tsplot (data , plotf , ax = ax , label = label ,
1209+ style = style , ** kwds )
1210+ ax .grid (self .grid )
1211+ lines .append (newlines [0 ])
1212+ leg_label = to_leg_label (label , col_num )
1213+ labels .append (leg_label )
1214+ except AttributeError as inst : #non-numeric
1215+ msg = ('Unable to plot %s,\n '
1216+ 'error was: %s' % (str (data ), str (inst )))
1217+ print msg
1218+
12011219 if isinstance (data , Series ):
12021220 ax = self ._get_ax (0 ) # self.axes[0]
12031221 style = self .style or ''
12041222 label = com .pprint_thing (self .label )
12051223 kwds = kwargs .copy ()
12061224 self ._maybe_add_color (colors , kwds , style , 0 )
12071225
1208- newlines = tsplot (data , plotf , ax = ax , label = label ,
1209- style = self .style , ** kwds )
1210- ax .grid (self .grid )
1211- lines .append (newlines [0 ])
1212- leg_label = to_leg_label (label , 0 )
1213- labels .append (leg_label )
1226+ _plot (data , 0 , ax , label , self .style , ** kwds )
12141227 else :
12151228 for i , col in enumerate (data .columns ):
12161229 label = com .pprint_thing (col )
@@ -1220,13 +1233,7 @@ def to_leg_label(label, i):
12201233
12211234 self ._maybe_add_color (colors , kwds , style , i )
12221235
1223- newlines = tsplot (data [col ], plotf , ax = ax , label = label ,
1224- style = style , ** kwds )
1225-
1226- lines .append (newlines [0 ])
1227- leg_label = to_leg_label (label , i )
1228- labels .append (leg_label )
1229- ax .grid (self .grid )
1236+ _plot (data [col ], i , ax , label , style , ** kwds )
12301237
12311238 self ._make_legend (lines , labels )
12321239
0 commit comments