@@ -224,7 +224,16 @@ def plot_numbers(fsom, level="clusters", max_node_size=0, **kwargs):
224224
225225
226226def plot_variable (
227- fsom , variable , cmap = FlowSOM_colors (), labels = None , text_size = 5 , text_color = "black" , lim = None , title = None , ** kwargs
227+ fsom ,
228+ variable ,
229+ cmap = FlowSOM_colors (),
230+ labels = None ,
231+ text_size = 5 ,
232+ text_color = "black" ,
233+ lim = None ,
234+ title = None ,
235+ categorical = True ,
236+ ** kwargs ,
228237):
229238 """Plot FlowSOM grid or tree, colored by node values given in variable.
230239
@@ -260,7 +269,14 @@ def plot_variable(
260269 if labels is not None :
261270 ax = add_text (ax , layout , labels , text_size = text_size , text_color = text_color , ha = ["center" ], va = ["center" ])
262271 ax , fig = add_legend (
263- fig = fig , ax = ax , data = variable , title = "Marker" , cmap = cmap , location = "upper left" , bbox_to_anchor = (1.04 , 1 )
272+ fig = fig ,
273+ ax = ax ,
274+ data = variable ,
275+ title = "Marker" ,
276+ cmap = cmap ,
277+ location = "upper left" ,
278+ bbox_to_anchor = (1.04 , 1 ),
279+ categorical = categorical ,
264280 )
265281 ax .axis ("equal" )
266282 if title is not None :
@@ -294,7 +310,7 @@ def plot_marker(fsom, marker, ref_markers=None, lim=None, cmap=FlowSOM_colors(),
294310 lim = (mfis [:, indices_markers ].min (), mfis [:, indices_markers ].max ())
295311 marker = list (get_channels (fsom , marker ).keys ())[0 ]
296312 marker_index = np .where (fsom .get_cell_data ().var_names == marker )[0 ][0 ]
297- fig = plot_variable (fsom , variable = mfis [:, marker_index ], cmap = cmap , lim = lim , ** kwargs )
313+ fig = plot_variable (fsom , variable = mfis [:, marker_index ], cmap = cmap , lim = lim , categorical = False , ** kwargs )
298314 return fig
299315
300316
0 commit comments