病种分析的柱形图、折线图表达 \* { margin: 0; padding: 0; outline: 0; } body { font-family: "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif; line-height: 1.6; } .\_\_page\_content\_\_ { max-width: 667px; margin: 0 auto; padding: 20px; text-size-adjust: 100%; color: rgba(0, 0, 0, 0.9); padding-bottom: 64px; } .title { user-select: text; font-size: 22px; line-height: 1.4; margin-bottom: 14px; font-weight: 500; } .\_\_meta\_\_ { color: rgba(0, 0, 0, 0.3); font-size: 15px; line-height: 20px; hyphens: auto; word-break: break-word; margin-bottom: 50px; } .\_\_meta\_\_ .nick\_name { color: #576B95; } .\_\_meta\_\_ .copyright { color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.05); padding: 0 4px; margin: 0 10px 10px 0; } blockquote.source { padding: 10px; margin: 30px 0; border-left: 5px solid #ccc; color: #333; font-style: italic; word-wrap: break-word; } blockquote.source a { cursor: pointer; text-decoration: underline; } .item\_show\_type\_0 > section { margin-top: 0; margin-bottom: 24px; } a { color: #576B95; text-decoration: none; cursor: default; } .text\_content { margin-bottom: 50px; user-select: text; font-size: 17px; white-space: pre-wrap; word-wrap: break-word; line-height: 28px; hyphens: auto; } .picture\_content .picture\_item { margin-bottom: 30px; } .picture\_content .picture\_item .picture\_item\_label { text-align: center; } img { max-width: 100%; } .pay\_subscribe\_notice { margin: 30px 0; padding: 20px; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; } .pay\_subscribe\_badge { display: inline-block; padding: 4px 12px; background: #faad14; color: #fff; border-radius: 4px; font-size: 14px; font-weight: 500; margin-bottom: 12px; } .pay\_subscribe\_desc { font-size: 15px; line-height: 1.8; color: rgba(0, 0, 0, 0.7); margin-bottom: 12px; } .pay\_subscribe\_hint { font-size: 13px; color: rgba(0, 0, 0, 0.4); } .\_\_bottom-bar\_\_ { display: flex; justify-content: space-between; align-items: center; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; padding: 8px 20px; background: white; box-sizing: border-box; border-top: 1px solid rgba(0, 0, 0, 0.2); } .\_\_bottom-bar\_\_ .left { display: flex; align-items: center; font-size: 15px; white-space: nowrap; } .\_\_bottom-bar\_\_ .right { display: flex; } .\_\_bottom-bar\_\_ .sns\_opr\_btn { display: flex; align-items: center; user-select: none; background: transparent; border: 0; color: rgba(0, 0, 0, 0.9); font-size: 14px; } .\_\_bottom-bar\_\_ .sns\_opr\_btn:not(:last-child) { margin-right: 16px; } .\_\_bottom-bar\_\_ .sns\_opr\_btn > img { margin-right: 4px; }
病种分析的柱形图、折线图表达
原创 Hi您好 恒健知行 2025-09-25 18:30 安徽
在前面的公众号文章中,柱形图、折线图和二者的组合图出现的比较多,很多绘图工具都可以制作上述图形,包括经典的Excel,常见的统计工具R、Python、SAS…,前端组件Echarts,D3,AntV…,之前最通用的是Excel,人人都可以用Excel来绘制简单图例。但今天有了更简单的途径——人工智能。
下面我们通过对话方式来让AI帮忙做直方图、折线图及组合图。
1.样例数据
这里我们提供一份样例科室病种样表.xlsx。数据是某医院各科室/病区2022-2024年度的关于DRG病种的相关指标,包括了DRGS组数、总权重、病例数、平均费用、平均药费、耗材费、平均住院日、费用消耗指数、时间消耗指数、低风险死亡率和中低风险死亡率指标。同时,由于部分科室/病区在某些指标上没有统计值,因此数据有一定的缺失。数据形如:
年份
病 区
CMI
DRGS组数
总权重
病例数
平均费用
平均药费
耗材费
平均住院日
费用消耗指数
时间消耗指数
低风险死亡率
中低风险死亡率
2022
其他
1.30
24
25
25
20,904
6,267
117,362
13
1.09
1.13
0.00%
0.00%
2022
产科
0.40
32
3,779
3,779
5,279
979
1,959,176
5
0.97
1.14
0.00%
0.00%
2022
胆胰微创外科
1.28
114
793
793
8,106
5,880
3,111,119
9
0.97
0.89
0.00%
1.52%
2022
儿科
0.42
129
3,399
3,399
4,259
1,312
1,223,051
7
0.81
1.04
0.44%
1.61%
2022
耳鼻咽喉科二区
1.66
77
681
681
22,665
3,446
9,340,507
8
0.97
1.07
0.00%
0.00%
2022
耳鼻咽喉科一区
0.85
116
1,137
1,137
11,067
3,565
1,853,372
0.95
1.01
0.00%
0.00%
2022
风湿内科
0.60
63
610
610
7,920
2,089
133,669
11
0.96
1.10
12.50%
11.76%
2022
妇科
0.78
50
1,997
1,997
10,413
2,034
2,705,093
8
0.95
1.05
0.00%
0.00%
2.折线图
比如要做一个X轴是年份,Y轴是所有科室的汇总DRGS组数的折线图,我们有期望可以导出这个图片。在将附件上传给Deepseek大模型之后,我们可以用下面的提示词:
请对附件数据进行可视化分析,制作一份折线图,要求:
结果如下,还提供了“下载”按钮,直接下载想要的图片。
3.柱形图
如果你期望一个X轴是科室,Y轴是每个年份的DRGS组数(各年份对比)的柱形图,可以如下提问:
请对附件数据进行可视化分析,制作一份直方图,要求:
下载后的图形如下图:
4.双坐标轴组合图
如下提问
请对附件数据进行可视化分析,制作一份直方、折线的组合图,包括两个Y轴要求:
输出效果:
5.探讨
首先,大模型的出现进一步降低了数据可视化的门槛。关于使用人工智能大模型作图,有几点值得探讨:
(1)数据安全方面,用Deeepseek等大模型画图,可以用于个人使用,数据可以上网,在数据安全方面没有太多约束。
(2)数据准确性方面。Deepseek有思维链推理,生成的图片是有过程的,形如下图。数据、运算都是可查可以校验的。
(3)图例的精细化方面。提示词的详细程度对图例的精确性有一定的影响,但并不需要担心AI大模型给的图例不对,细节的差异可以反复的通过对话进行迭代调整,直到到达想要的效果。
系列文章:
运营分析方法之波士顿矩阵图—Deepseek帮忙还需要其他工具吗?
恒健知行
 阅读 赞  分享 ’%3E %3Cg transform=‘translate(0 -2.349)’%3E %3Cpath d=‘M0 2.349h24v24H0z’/%3E %3Cpath fill=’%23576B95’ d=‘M16.45 7.68c-.954 0-1.94.362-2.77 1.113l-1.676 1.676-1.853-1.838a3.787 3.787 0 0 0-2.63-.971 3.785 3.785 0 0 0-2.596 1.112 3.786 3.786 0 0 0-1.113 2.687c0 .97.368 1.938 1.105 2.679l7.082 6.527 7.226-6.678a3.787 3.787 0 0 0 .962-2.618 3.785 3.785 0 0 0-1.112-2.597A3.687 3.687 0 0 0 16.45 7.68zm3.473.243a4.985 4.985 0 0 1 1.464 3.418 4.98 4.98 0 0 1-1.29 3.47l-.017.02-7.47 6.903a.9.9 0 0 1-1.22 0l-7.305-6.73-.008-.01a4.986 4.986 0 0 1-1.465-3.535c0-1.279.488-2.56 1.465-3.536A4.985 4.985 0 0 1 7.494 6.46c1.24-.029 2.49.4 3.472 1.29l.01.01L12 8.774l.851-.85.01-.01c1.046-.951 2.322-1.434 3.59-1.434 1.273 0 2.52.49 3.472 1.442z’/%3E %3C/g%3E %3C/g%3E %3C/g%3E%3C/svg%3E) 推荐 ’ fill=’%23000’ fill-opacity=’.9’/%3E%3C/svg%3E) 留言