@@ -227,16 +227,21 @@ def set_patchprops(self, fill_poly, **kwargs):
227227 func (val )
228228
229229 def _xy_from_y (self , y ):
230- y = ma .asarray (y )
230+ try : y = ma .asarray (y )
231+ except TypeError : return None , None
232+ except ValueError : return None , None
231233 if len (y .shape ) == 1 :
232234 y = y [:,newaxis ]
233235 nr , nc = y .shape
234236 x = arange (nr )
235237 return x ,y
236238
237239 def _xy_from_xy (self , x , y ):
238- x = ma .asarray (x )
239- y = ma .asarray (y )
240+ try :
241+ x = ma .asarray (x )
242+ y = ma .asarray (y )
243+ except TypeError : return None , None
244+ except ValueError : return None , None
240245 if len (x .shape ) == 1 :
241246 x = x [:,newaxis ]
242247 if len (y .shape ) == 1 :
@@ -261,7 +266,7 @@ def _plot_1_arg(self, y, **kwargs):
261266 yorig = y
262267 x , y = self ._xy_from_y (yorig )
263268
264- multicol = y .shape [1 ]> 1
269+ multicol = x is not None and y is not None and y .shape [1 ]> 1
265270
266271 if multicol :
267272
@@ -292,7 +297,7 @@ def _plot_2_args(self, tup2, **kwargs):
292297
293298 linestyle , marker , color = _process_plot_format (fmt )
294299
295- multicol = y .shape [1 ]> 1
300+ multicol = x is not None and y is not None and y .shape [1 ]> 1
296301
297302
298303 def makeline (x , y ):
@@ -317,7 +322,7 @@ def makeline(x, y):
317322
318323 xorig , yorig = tup2
319324 x , y = self ._xy_from_xy (xorig , yorig )
320- multicol = y .shape [1 ]> 1
325+ multicol = x is not None and y is not None and y .shape [1 ]> 1
321326
322327 def makeline (x , y ):
323328 color = self ._get_next_cycle_color ()
@@ -354,7 +359,7 @@ def _plot_3_args(self, tup3, **kwargs):
354359
355360 xorig , yorig , fmt = tup3
356361 x , y = self ._xy_from_xy (xorig , yorig )
357- multicol = y .shape [1 ]> 1
362+ multicol = x is not None and y is not None and y .shape [1 ]> 1
358363
359364 linestyle , marker , color = _process_plot_format (fmt )
360365
0 commit comments