@@ -1261,15 +1261,12 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1261
1261
1262
1262
# fix positions, noting that it can be a list of lists:
1263
1263
if not np .iterable (positions ):
1264
- positions = [positions ]
1264
+ positions = [np . asanyarray ([ positions ]) ]
1265
1265
elif any (np .iterable (position ) for position in positions ):
1266
1266
positions = [np .asanyarray (position ) for position in positions ]
1267
1267
else :
1268
1268
positions = [np .asanyarray (positions )]
1269
1269
1270
- if len (positions ) == 0 :
1271
- return []
1272
-
1273
1270
poss = []
1274
1271
for position in positions :
1275
1272
poss += self ._process_unit_info ([("x" , position )], kwargs )
@@ -1297,15 +1294,15 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1297
1294
linewidths = np .asarray (linewidths )
1298
1295
1299
1296
if len (lineoffsets ) == 0 :
1300
- lineoffsets = [ None ]
1297
+ raise ValueError ( ' lineoffsets cannot be empty' )
1301
1298
if len (linelengths ) == 0 :
1302
- linelengths = [None ]
1303
- if len (linewidths ) == 0 :
1304
- lineoffsets = [None ]
1299
+ raise ValueError ('linelengths cannot be empty' )
1305
1300
if len (linewidths ) == 0 :
1306
- lineoffsets = [ None ]
1301
+ raise ValueError ( 'linewidths cannot be empty' )
1307
1302
if len (colors ) == 0 :
1308
- colors = [None ]
1303
+ raise ValueError ('colors cannot be empty' )
1304
+ if len (linestyles ) == 0 :
1305
+ raise ValueError ('linestyles cannot be empty' )
1309
1306
try :
1310
1307
# Early conversion of the colors into RGBA values to take care
1311
1308
# of cases like colors='0.5' or colors='C1'. (Issue #8193)
0 commit comments