Skip to content

Commit

Permalink
decreased linewidth for more clear plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
artuurC committed Aug 31, 2023
1 parent 8cd4e8b commit c6f884c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/FlowSOM/pl/plot_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ def plot_stars(fsom, markers=None, cmap=FlowSOM_colors(), title=None, **kwargs):
pretty_markers,
coords=(max_x, max_y),
cmap=cmap,
max_star_height=max(scaled_node_size) * 2,
max_star_height=max(scaled_node_size) * 3,
star_height=1,
)
data = fsom.get_cluster_data()[:, markers].X
heights = scale_star_heights(data, scaled_node_size)
s = mc.PatchCollection(add_stars(layout, heights), cmap=cmap)
s.set_array(range(data.shape[1]))
s.set_edgecolor("black")
s.set_linewidth(0.2)
s.set_linewidth(0.1)
s.set_zorder(3)
ax.add_collection(s)
ax.axis("equal")
Expand Down Expand Up @@ -302,7 +302,7 @@ def plot_pies(
p = mc.PatchCollection(patches)
p.set_facecolor([color_dict.get(key) for key in table.index.values])
p.set_edgecolor("black")
p.set_linewidth(0.2)
p.set_linewidth(0.1)
p.set_zorder(3)
ax.add_collection(p)

Expand Down
9 changes: 5 additions & 4 deletions src/FlowSOM/pl/plot_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def add_legend(fig, ax, data, title, cmap, location="best", orientation="horizon
frameon=False,
title=title,
bbox_to_anchor=bbox_to_anchor, # (1, 0.5),
fontsize="small",
title_fontsize="small",
fontsize=5,
title_fontsize=6,
)
plt.gca().add_artist(legend)
return ax, fig
Expand Down Expand Up @@ -152,7 +152,7 @@ def plot_FlowSOM(
n = mc.PatchCollection(nodes)
n.set_facecolor(["#C7C7C7" if tf else "#FFFFFF" for tf in isEmpty]) # "white")
n.set_edgecolor("black")
n.set_linewidth(0.2)
n.set_linewidth(0.1)
n.set_zorder(2)
ax.add_collection(n)

Expand All @@ -174,6 +174,7 @@ def plot_star_legend(fig, ax, markers, coords=(0, 0), cmap=FlowSOM_colors(), max
star_height = np.repeat(star_height, len(markers)).tolist()
else:
assert len(star_height) == n_markers, f"Make sure star_height is an array with the same length as markers"
star_height = np.divide(star_height, max(star_height)) * max_star_height
x = 2 * np.pi / (n_markers * 2)
y = 2 * np.pi / n_markers
circular_coords = np.linspace(start=x, stop=x + (n_markers - 1) * y, num=n_markers)
Expand Down Expand Up @@ -232,7 +233,7 @@ def plot_star_legend(fig, ax, markers, coords=(0, 0), cmap=FlowSOM_colors(), max
l = mc.PatchCollection(add_wedges(np.array((x_coord, coords[1])), star_height), cmap=cmap)
l.set_array(range(n_markers))
l.set_edgecolor("black")
l.set_linewidth(0.5)
l.set_linewidth(0.1)
ax.add_collection(l)
ax.axis("equal")

Expand Down

0 comments on commit c6f884c

Please sign in to comment.