Skip to content

Commit

Permalink
adding changes, no seaborn
Browse files Browse the repository at this point in the history
  • Loading branch information
nandsra21 committed Mar 15, 2024
1 parent 6b04d47 commit 62b7be0
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/pathogen_embed/pathogen_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,9 @@ def embed(args):
}

plot_df = pd.DataFrame(plot_data)
ax = sns.scatterplot(
data=plot_df,
x="x",
y="y",
alpha=0.5,
)
plt.scatter(plot_df["x"], plot_df["y"], alpha=0.5)
plt.xlabel("x")
plt.ylabel("y")
plt.savefig(args.output_figure)
plt.close()

Expand Down Expand Up @@ -371,13 +368,15 @@ def cluster(args):
plot_data["cluster"] = clusterer.labels_.astype(str)

plot_df = pd.DataFrame(plot_data)
ax = sns.scatterplot(
data=plot_df,
x="x",
y="y",
hue="cluster",
alpha=0.5,
)
clusters = plot_df['cluster'].unique()
colors = plt.cm.tab10.colors[:len(clusters)]
for i, cluster in enumerate(clusters):
cluster_data = plot_df[plot_df['cluster'] == cluster]
plt.scatter(cluster_data["x"], cluster_data["y"], color=colors[i], label=f'Cluster {cluster}', alpha=0.5)

plt.xlabel("x")
plt.ylabel("y")
plt.legend()
plt.savefig(args.output_figure)
plt.close()

Expand Down

0 comments on commit 62b7be0

Please sign in to comment.