上传文件至「/」
求职者人物画像
This commit is contained in:
27
clustering_distribution_plot.py
Normal file
27
clustering_distribution_plot.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
# 读取你的聚类结果CSV
|
||||
df = pd.read_csv("./clustering_result.csv")
|
||||
# 统计各赛道人数
|
||||
cluster_count = df["技术赛道标签"].value_counts()
|
||||
|
||||
# 绘图设置
|
||||
plt.rcParams["font.sans-serif"] = ["SimHei"]
|
||||
plt.figure(figsize=(10,7))
|
||||
colors = ["#FF6B6B","#4ECDC4","#45B7D1","#96CEB4","#FECA57","#DDA0DD"]
|
||||
|
||||
# 绘制饼图
|
||||
wedges, texts, autotexts = plt.pie(
|
||||
cluster_count.values,
|
||||
labels=cluster_count.index,
|
||||
colors=colors,
|
||||
autopct="%1.1f%%",
|
||||
startangle=90,
|
||||
textprops={"fontsize":10}
|
||||
)
|
||||
|
||||
plt.title("简历聚类-技术赛道人数分布", fontsize=16, pad=20)
|
||||
plt.savefig("聚类赛道分布饼图.png", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user