@@ -955,19 +955,10 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
955
955
if not iterable (xmax ):
956
956
xmax = [xmax ]
957
957
958
- y = np .asarray (y )
959
- xmin = np .asarray (xmin )
960
- xmax = np .asarray (xmax )
958
+ y = np .ravel (y )
961
959
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 )
971
962
972
963
verts = [((thisxmin , thisy ), (thisxmax , thisy ))
973
964
for thisxmin , thisxmax , thisy in zip (xmin , xmax , y )]
@@ -1044,23 +1035,12 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
1044
1035
if not iterable (ymax ):
1045
1036
ymax = [ymax ]
1046
1037
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 )
1061
1041
1062
1042
verts = [((thisx , thisymin ), (thisx , thisymax ))
1063
- for thisx , ( thisymin , thisymax ) in zip (x , Y )]
1043
+ for thisx , thisymin , thisymax in zip (x , ymin , ymax )]
1064
1044
#print 'creating line collection'
1065
1045
coll = mcoll .LineCollection (verts , colors = colors ,
1066
1046
linestyles = linestyles , label = label )
0 commit comments