@@ -955,19 +955,10 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
955955 if not iterable (xmax ):
956956 xmax = [xmax ]
957957
958- y = np .asarray (y )
959- xmin = np .asarray (xmin )
960- xmax = np .asarray (xmax )
958+ y = np .ravel (y )
961959
962- if len (xmin ) == 1 :
963- xmin = np .resize (xmin , y .shape )
964- if len (xmax ) == 1 :
965- xmax = np .resize (xmax , y .shape )
966-
967- if len (xmin ) != len (y ):
968- raise ValueError ('xmin and y are unequal sized sequences' )
969- if len (xmax ) != len (y ):
970- raise ValueError ('xmax and y are unequal sized sequences' )
960+ xmin = np .resize (xmin , y .shape )
961+ xmax = np .resize (xmax , y .shape )
971962
972963 verts = [((thisxmin , thisy ), (thisxmax , thisy ))
973964 for thisxmin , thisxmax , thisy in zip (xmin , xmax , y )]
@@ -1044,23 +1035,12 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
10441035 if not iterable (ymax ):
10451036 ymax = [ymax ]
10461037
1047- x = np .asarray (x )
1048- ymin = np .asarray (ymin )
1049- ymax = np .asarray (ymax )
1050- if len (ymin ) == 1 :
1051- ymin = np .resize (ymin , x .shape )
1052- if len (ymax ) == 1 :
1053- ymax = np .resize (ymax , x .shape )
1054-
1055- if len (ymin ) != len (x ):
1056- raise ValueError ('ymin and x are unequal sized sequences' )
1057- if len (ymax ) != len (x ):
1058- raise ValueError ('ymax and x are unequal sized sequences' )
1059-
1060- Y = np .array ([ymin , ymax ]).T
1038+ x = np .ravel (x )
1039+ ymin = np .resize (ymin , x .shape )
1040+ ymax = np .resize (ymax , x .shape )
10611041
10621042 verts = [((thisx , thisymin ), (thisx , thisymax ))
1063- for thisx , ( thisymin , thisymax ) in zip (x , Y )]
1043+ for thisx , thisymin , thisymax in zip (x , ymin , ymax )]
10641044 #print 'creating line collection'
10651045 coll = mcoll .LineCollection (verts , colors = colors ,
10661046 linestyles = linestyles , label = label )
0 commit comments