pythonic生物人

JAMA复现|展示32篇纳入研究的临床实践指南在 NEATS评分中的表现!

本文介绍了基于《JAMA》(2024 IF 63.1)中 Figure 1 的复现,该图采用Coxscomb Chart(鸡冠图,亦称玫瑰图)展示了32篇纳入研究的临床实践指南在NEATS评分中的表现。本文使用模拟数据,仅为示例目的,不具备现实意义,且细节未必与原文完全一致。


论文简介

JAMA Netw Open. 2021;4(12):e2136263. doi:10.1001/jamanetworkopen.2021.36263
JAMA Netw Open. 2021;4(12):e2136263. doi:10.1001/jamanetworkopen.2021.36263

Figure 1原图,

Image

Figure 1 是一个Coxscomb Chart(鸡冠图,也称为玫瑰图),用于展示 32 篇纳入研究的临床实践指南(CPGs)在National Guideline Clearinghouse Extent of Adherence to Trustworthy Standards (NEATS)评分中的表现。论文明确指出,该图表使用不同的颜色来表示National Academy of Medicine (NAM)标准的各个组成部分,扇形的长度(或“射线高度”)反映了指南在 NEATS 工具评估下的质量得分。


复现图

使用Python matplotlib复现Figure 1,效果如下,

Image

核心代码,

# 柱子设置
width = 2 * np.pi / len(studies) * 0.95
pillar_heights = []
for i in range(len(studies)):
    bottom = 0
for j in range(len(neats_elements)):
if data[i, j] == 1:
            ax.bar(theta[i],
1,
                   width=width,
                   bottom=bottom,
                   color=colors[j],
                   edgecolor='white')
            bottom += 1
    pillar_heights.append(bottom)

# 设置标签
for label, angle, height in zip(studies, theta, pillar_heights):
    angle_deg = angle * 180 / np.pi
    label_text = label
if0 <= angle_deg < 90or270 <= angle_deg <= 360:
        ha = 'left'
        rotation = angle_deg
else:
        ha = 'right'
        rotation = angle_deg - 180
    label_radius = height + 0.4
    ax.text(angle,
            label_radius,
            label_text,
            ha=ha,
            va='center',
            rotation=rotation,
            fontsize=6,
            rotation_mode='anchor')

购买介绍

本文介绍至此结束,数据、代码及详细注释将后续扩展至项目中 👉Python matplotlib保姆级教程 。项目将持续更新Python可视化基础+实战案例,提供详尽的代码注释和丰富的解读,帮助您轻掌握可视化。

作者仅分享案例项目,不提供额外的答疑服务,购买前请提前咨询。

交流学习

图片

-END-

推荐阅读:

👉Python matplotlib保姆级教程
👉Python seaborn保姆级教程

图片