Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cb216bb

Browse files
Create pltBar.py
1 parent bd3a3c8 commit cb216bb

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

‎jobSkill/pltBar.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
4+
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']
5+
params = {
6+
'axes.labelsize': '14',
7+
'xtick.labelsize': '14',
8+
'ytick.labelsize': '13',
9+
'lines.linewidth': '2',
10+
'legend.fontsize': '20',
11+
'figure.figsize': '26, 24'
12+
}
13+
plt.style.use("ggplot")
14+
plt.rcParams.update(params)
15+
16+
# 筛选分词中高频的
17+
barDir = {
18+
'PYTHON': 2283,
19+
'LINUX': 981,
20+
'算法': 658,
21+
'运维': 530,
22+
'数据库(MySql,Sql,Redis等)': 1021,
23+
'SHELL': 996,
24+
'数据分析/挖掘': 695,
25+
'WEB': 454,
26+
'测试用例': 515,
27+
'MATLAB': 221,
28+
'PERL': 209,
29+
'HIVE': 122,
30+
'HADOOP': 176,
31+
'SPARK': 146,
32+
'TENSORFLOW': 136,
33+
'多线程': 127,
34+
'AI': 106,
35+
'SAS': 104,
36+
'视觉/图像处理': 180,
37+
'人工智能': 170,
38+
'HTTP': 90,
39+
'DOCKER': 82,
40+
'DJANGO': 82,
41+
}
42+
43+
44+
fig, ax = plt.subplots(figsize=(20, 10), dpi=100)
45+
46+
# 添加刻度标签
47+
labels = np.array(list(barDir.keys()))
48+
ax.barh(range(len(barDir.values())), barDir.values(), tick_label=labels, alpha=1)
49+
50+
ax.set_xlabel('Python技术词的次数', color='k')
51+
ax.set_title('Python工作高频技术词')
52+
53+
54+
# 为每个条形图添加数值标签
55+
for x, y in enumerate(barDir.values()):
56+
ax.text(y + 0.5, x, y, va='center', fontsize=14)
57+
58+
# 显示图形
59+
plt.show()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /