@@ -60,6 +60,8 @@ def plot_FlowSOM(
60
60
view : str = "MST" ,
61
61
background_values : np .array = None ,
62
62
background_cmap = gg_color_hue (),
63
+ background_size = 1.5 ,
64
+ equal_background_size = False ,
63
65
node_sizes : np .array = None ,
64
66
max_node_size : int = 1 ,
65
67
ref_node_size : int = None ,
@@ -76,6 +78,10 @@ def plot_FlowSOM(
76
78
:type background_values: np.array
77
79
:param background_cmap: A colormap for the background colors
78
80
:type background_cmap: Colormap
81
+ :param background_size: The size of the background nodes relative to the nodes
82
+ :type background_size: float
83
+ :param equal_background_size: If True the background nodes will be equally sized
84
+ :type equal_background_size: boolean
79
85
:param node_sizes: An array with the node sizes. Will be scaled between 0
80
86
and max_node_size and transformed with a sqrt. Default is the percentages
81
87
:type node_sizes: np.array
@@ -124,7 +130,21 @@ def plot_FlowSOM(
124
130
125
131
# Add background
126
132
if background_values is not None :
127
- background = add_nodes (layout , node_sizes * 1.5 )
133
+ if equal_background_size :
134
+ background_size = np .repeat (max_node_size * background_size , len (background_values ))
135
+ else :
136
+ background_size = (
137
+ parse_node_sizes (
138
+ fsom ,
139
+ view = view ,
140
+ node_sizes = None ,
141
+ max_node_size = max_node_size ,
142
+ ref_node_size = ref_node_size ,
143
+ equal_node_size = False ,
144
+ )
145
+ * background_size
146
+ )
147
+ background = add_nodes (layout , background_size )
128
148
b = mc .PatchCollection (background , cmap = background_cmap )
129
149
if background_values .dtype == np .float64 or background_values .dtype == np .int64 :
130
150
b .set_array (background_values )
0 commit comments