File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1350,12 +1350,15 @@ def _update_element_table_mapping_label_colors(
1350
1350
render_elements
1351
1351
), "Either one color should be given or the length should be equal to the number of elements being plotted."
1352
1352
for index , element_name in enumerate (render_elements ):
1353
- for table_name in element_table_mapping [element_name ].copy ():
1354
- if (
1355
- params .color [index ] not in sdata [table_name ].obs .columns
1356
- and params .color [index ] not in sdata [table_name ].var_names
1357
- ):
1358
- element_table_mapping [element_name ].remove (table_name )
1353
+ if len (element_table_mapping [element_name ]) != 0 :
1354
+ for table_name in element_table_mapping [element_name ].copy ():
1355
+ if (
1356
+ params .color [index ] not in sdata [table_name ].obs .columns
1357
+ and params .color [index ] not in sdata [table_name ].var_names
1358
+ ):
1359
+ element_table_mapping [element_name ].remove (table_name )
1360
+ else :
1361
+ params .color [index ] = None
1359
1362
1360
1363
# We only want one table containing the color column per element
1361
1364
for element_name , table_set in element_table_mapping .items ():
You can’t perform that action at this time.
0 commit comments