{ "schema_version": 1, "scope": "144 recipes plus 3 complete composition templates (SEM and two SHAP compositions)", "cards": [ { "id": "basic.grouped_bar", "display_name": "分组柱状对比", "tags": [ "比较", "误差" ], "purpose": "不同方法在多个指标上谁更高、波动多大?", "data_requirements": [ "类别×方法的数值矩阵", "每项误差长度", "指标名称" ], "composition": "单面板;每类并排多根柱", "visual_features": [ "浅填充与较深描边", "柱后阴影", "误差棒", "最优星号与均值线" ], "adaptation_notes": "背景为固定透明度纯色,非连续渐变;误差含义需明确;不同量纲不直接共用高度比较。", "number": 1, "kind": "recipe", "legacy_title": "分组柱状图(Grouped Bar)— 淡色填充 + 原色边框 + 参考线 + 顶部数值 + 最优高亮", "legacy_ref": "basic #1", "source": { "original_code": "sources/basic.grouped_bar/original.py", "execution_code": "sources/basic.grouped_bar/render.py", "recipe_section": "sources/basic.grouped_bar/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "ace069b2ffb44f2d57726060530e9be78567bacec59c4b6bdb65c9dfcd3f3470", "code_sha256": "f7be3f588354a6775e9a1c5ef0d3a3c09ab971af2d9d18fbd9129d9c7c41e34b", "execution_sha256": "f7be3f588354a6775e9a1c5ef0d3a3c09ab971af2d9d18fbd9129d9c7c41e34b", "code_view": "sources/basic.grouped_bar/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.grouped_bar-1.png", "thumbnail": "thumbnails/basic.grouped_bar-1.jpg", "sha256": "a04580546db678cce96b8061a7a8164139c43502821f1807c78301761af7b724", "pixels": [ 1620, 990 ], "native_inches": [ 9.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 31, "operation": "bar", "code": " ax.bar(x + offset + 0.02, vals, width, color='#cccccc', alpha=0.08, zorder=1)" }, { "line": 33, "operation": "bar", "code": " bars = ax.bar(x + offset, vals, width, yerr=stds[name], capsize=3, color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.5 if is_ours else 1.2, label=name, zorder=2, error_kw={'elinewidth': 0.8, 'capthick': 0.6, 'color': COLORS['text']})" } ], "literal_colormaps": [], "aliases": [ "grouped bar", "误差棒柱状图" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.grouped_bar.md", "fidelity_checkpoints": [ { "feature": "浅柱、描边与背后阴影", "preserve": "保留 _lighten 浅填充、同色深描边、后方偏移浅阴影与独立误差棒,不合并成实色柱。最优高亮和均值参考有数据依据时保留。", "allowed_adaptation": "组数、柱宽、误差长度、标签位置可调;误差和最优方向按数据含义计算。", "evidence": [ { "line": 31, "end_line": 31, "code": " ax.bar(x + offset + 0.02, vals, width, color='#cccccc', alpha=0.08, zorder=1)", "href": "sources/basic.grouped_bar/original.html#L31" }, { "line": 33, "end_line": 37, "code": " bars = ax.bar(x + offset, vals, width, yerr=stds[name], capsize=3,\n color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i],\n linewidth=1.5 if is_ours else 1.2,\n label=name, zorder=2,\n error_kw={'elinewidth': 0.8, 'capthick': 0.6, 'color': COLORS['text']})", "href": "sources/basic.grouped_bar/original.html#L33" }, { "line": 51, "end_line": 51, "code": "ax.axhline(y=global_mean, color=COLORS['ref_line'], linestyle='--', linewidth=0.8, alpha=0.4)", "href": "sources/basic.grouped_bar/original.html#L51" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.stacked_bar", "display_name": "堆叠柱与总量趋势", "tags": [ "组成", "趋势" ], "purpose": "各时期总量由哪些部分构成?", "data_requirements": [ "时期×成分的非负数值", "类别标签" ], "composition": "单面板堆叠柱;柱顶总量折线", "visual_features": [ "浅填充和描边", "柱内占比", "末端同比标注" ], "adaptation_notes": "成分应可相加;总量与百分比读法分开;不是各组原始样本分布。", "number": 2, "kind": "recipe", "legacy_title": "堆叠柱状图(Stacked Bar)— 淡色填充 + 原色边框 + 趋势线 + 自动对比度标签 + 同比变化", "legacy_ref": "basic #2", "source": { "original_code": "sources/basic.stacked_bar/original.py", "execution_code": "sources/basic.stacked_bar/render.py", "recipe_section": "sources/basic.stacked_bar/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "b4028936b1fe02fdcf5d6eaa673898844c7e071dcf8e7ea29756abf12548db58", "code_sha256": "83bab8adef07920d4fa5dd635c348ab1bc6233d600c923bcf9fad5c74dbd5c66", "execution_sha256": "83bab8adef07920d4fa5dd635c348ab1bc6233d600c923bcf9fad5c74dbd5c66", "code_view": "sources/basic.stacked_bar/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.stacked_bar-1.png", "thumbnail": "thumbnails/basic.stacked_bar-1.jpg", "sha256": "95e27b5fc0f703181616eedeb61b3f0efa99a44525ce13388c09099769ce09d5", "pixels": [ 1440, 990 ], "native_inches": [ 8.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 22, "operation": "bar", "code": " bars = ax.bar(x, vals_arr, bar_width, bottom=bottom, color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2, label=name, zorder=2)" }, { "line": 39, "operation": "plot", "code": "ax.plot(x, totals, 'o-', color=COLORS['text'], linewidth=1.5, markersize=5, markeredgecolor='white', markeredgewidth=1, zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.stacked_bar.md", "fidelity_checkpoints": [ { "feature": "堆叠内部与柱顶总量", "preserve": "保留浅填充深描边、逐层 bottom 累加及柱顶总量折线,内部标签与总量标签分开。", "allowed_adaptation": "成分数、时间点、位置与精度可调;百分比和总量分清,成分必须可相加。", "evidence": [ { "line": 22, "end_line": 24, "code": " bars = ax.bar(x, vals_arr, bar_width, bottom=bottom,\n color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i],\n linewidth=1.2, label=name, zorder=2)", "href": "sources/basic.stacked_bar/original.html#L22" }, { "line": 39, "end_line": 40, "code": "ax.plot(x, totals, 'o-', color=COLORS['text'], linewidth=1.5, markersize=5,\n markeredgecolor='white', markeredgewidth=1, zorder=3)", "href": "sources/basic.stacked_bar/original.html#L39" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.line", "display_name": "多序列折线与分层区间带", "tags": [ "趋势", "误差" ], "purpose": "不同序列如何变化,波动范围是否重叠?", "data_requirements": [ "有序横轴", "各序列数值与误差宽度" ], "composition": "单面板多折线;嵌套色带", "visual_features": [ "三层透明置信带", "不同点形", "主序列加粗", "极值箭头" ], "adaptation_notes": "背景为纯色;色带为三档叠加,非连续渐变;示例误差随机生成,实用时替换真实区间。", "number": 3, "kind": "recipe", "legacy_title": "折线图(渐变填充 + 极值标注箭头 + 微妙网格)", "legacy_ref": "basic #3", "source": { "original_code": "sources/basic.line/original.py", "execution_code": "sources/basic.line/render.py", "recipe_section": "sources/basic.line/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "7394dddd81fe16639c8118017d7db66536a7258fdb3dc7a87cd11782695d16c4", "code_sha256": "b678fb5bfd039953ddea93af6473f8d7e85f03c48987253400cde289b2f8aacf", "execution_sha256": "b678fb5bfd039953ddea93af6473f8d7e85f03c48987253400cde289b2f8aacf", "code_view": "sources/basic.line/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.line-1.png", "thumbnail": "thumbnails/basic.line-1.jpg", "sha256": "97742c0485719ad49a91a847413c4c03dbcad05d99c0540af0d5d8017fe7828d", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 29, "operation": "fill_between", "code": " ax.fill_between(x, y - noise * (1 - layer * 0.2), y + noise * (1 - layer * 0.2), alpha=alpha, color=PALETTE[i], linewidth=0)" }, { "line": 33, "operation": "plot", "code": " ax.plot(x, y, f'{markers[i]}-', color=PALETTE[i], linewidth=2.5 if is_ours else 1.8, markersize=7 if is_ours else 5, markeredgecolor='white', markeredgewidth=1.2, label=name, zorder=3)" }, { "line": 39, "operation": "scatter", "code": " ax.scatter(x[max_idx], y[max_idx], s=120 if is_ours else 80, color=PALETTE[i], edgecolor='white', linewidth=2, zorder=4, marker='*')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.line.md", "fidelity_checkpoints": [ { "feature": "三层色带的外缘可见性", "preserve": "区间由外向内收窄,alpha 按 0.15→0.08→0.03 对应外、中、内层。保留宽度与透明度的对应关系,不能仅因三层都存在就认定保真。", "allowed_adaptation": "以真实 SD/SE/CI 或明确的范围替换模拟宽度;区间含义、宽度和坐标可变。数据不支持区间时不造数,并说明省略。", "evidence": [ { "line": 25, "end_line": 30, "code": " noise = stds[name]\n\n # 渐变填充置信带\n for layer, alpha in enumerate([0.15, 0.08, 0.03]):\n ax.fill_between(x, y - noise * (1 - layer * 0.2), y + noise * (1 - layer * 0.2),\n alpha=alpha, color=PALETTE[i], linewidth=0)", "href": "sources/basic.line/original.html#L25" } ] }, { "feature": "主次折线、白边点和极值", "preserve": "保留主次线宽、不同点形、白色点边及有数据依据的极值标记;换色不应覆盖这些设置。", "allowed_adaptation": "主序列身份、点数、极值方向和标注位置按任务变化;没有主序列时不虚构主次。", "evidence": [ { "line": 32, "end_line": 47, "code": " # 主折线\n ax.plot(x, y, f'{markers[i]}-', color=PALETTE[i],\n linewidth=2.5 if is_ours else 1.8, markersize=7 if is_ours else 5,\n markeredgecolor='white', markeredgewidth=1.2, label=name, zorder=3)\n\n # 极值标注(最大值)\n max_idx = np.argmax(y)\n ax.scatter(x[max_idx], y[max_idx], s=120 if is_ours else 80, color=PALETTE[i],\n edgecolor='white', linewidth=2, zorder=4, marker='*')\n if is_ours:\n ax.annotate(f'★ {y[max_idx]:.1f}',\n xy=(x[max_idx], y[max_idx]),\n xytext=(x[max_idx] - 1.5, y[max_idx] + 3),\n fontsize=9, fontweight='bold', color=PALETTE[i],\n arrowprops=dict(arrowstyle='->', color=PALETTE[i], lw=1.2),\n bbox=dict(boxstyle='round,pad=0.3', facecolor='white',", "href": "sources/basic.line/original.html#L32" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.scatter_regression", "display_name": "散点回归与双边际密度", "tags": [ "关联", "分布", "组合" ], "purpose": "两个连续变量如何关联,各自分布怎样?", "data_requirements": [ "逐样本配对的x、y", "可选样本标签" ], "composition": "中央散点;上方x密度;右方y密度", "visual_features": [ "二维KDE等高线", "回归线与色带", "浅色边际填充", "拟合信息框" ], "adaptation_notes": "需要原始配对样本;KDE不适合常量或极少样本;示例回归色带不能直接当作已计算的正式置信区间。", "number": 4, "kind": "recipe", "legacy_title": "散点图(KDE 等高线 + 柔和边际密度 + 回归公式框 + 年份标签)", "legacy_ref": "basic #4", "source": { "original_code": "sources/basic.scatter_regression/original.py", "execution_code": "sources/basic.scatter_regression/render.py", "recipe_section": "sources/basic.scatter_regression/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "f8161d868b32136934b70693b70f3b4121d61f33679eb7e799d76f8076f0967d", "code_sha256": "cdc4139729096974ce284ce4ba3ae0b73a5f4ca8a2c031f006274d79d92921c7", "execution_sha256": "cdc4139729096974ce284ce4ba3ae0b73a5f4ca8a2c031f006274d79d92921c7", "code_view": "sources/basic.scatter_regression/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.scatter_regression-1.png", "thumbnail": "thumbnails/basic.scatter_regression-1.jpg", "sha256": "bef7a649ce1a31e5a7dbf51a55f7cedb2a835426d777e590de99d41ab9f5fec6", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 28, "operation": "contourf", "code": "ax_main.contourf(Xg, Yg, Z, levels=8, cmap='Blues', alpha=0.15)" }, { "line": 29, "operation": "contour", "code": "ax_main.contour(Xg, Yg, Z, levels=5, colors=PALETTE[0], alpha=0.2, linewidths=0.5)" }, { "line": 32, "operation": "scatter", "code": "ax_main.scatter(x, y, s=30, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.5, zorder=3)" }, { "line": 38, "operation": "plot", "code": "ax_main.plot(x_fit, p(x_fit), color=PALETTE[1], linewidth=2, zorder=4)" }, { "line": 42, "operation": "fill_between", "code": " ax_main.fill_between(x_fit, p(x_fit) - 1.96 * se * (0.3 + layer * 0.1), p(x_fit) + 1.96 * se * (0.3 + layer * 0.1), alpha=alpha, color=PALETTE[1], linewidth=0)" }, { "line": 56, "operation": "fill_between", "code": "ax_top.fill_between(xd, kde_x(xd), alpha=0.2, color=PALETTE[0])" }, { "line": 57, "operation": "plot", "code": "ax_top.plot(xd, kde_x(xd), color=PALETTE[0], linewidth=1.2)" }, { "line": 67, "operation": "fill_betweenx", "code": "ax_right.fill_betweenx(yd, kde_y(yd), alpha=0.2, color=PALETTE[0])" }, { "line": 68, "operation": "plot", "code": "ax_right.plot(kde_y(yd), yd, color=PALETTE[0], linewidth=1.2)" } ], "literal_colormaps": [ "Blues" ], "aliases": [], "related_ids": [ "competition.scatter_regression_marginals", "competition.kde_joint", "competition.hexbin_joint", "competition.bubble_joint", "competition.bubble_kde" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.scatter_regression.md", "fidelity_checkpoints": [ { "feature": "密度、回归和双边际的层次", "preserve": "保留中央浅密度面与轮廓、白边散点、回归色带,以及顶部和右侧的浅填充密度,不缩成单散点图。", "allowed_adaptation": "由真实配对样本计算回归和区间;KDE 带宽、边际大小、连续色相可调。", "evidence": [ { "line": 28, "end_line": 28, "code": "ax_main.contourf(Xg, Yg, Z, levels=8, cmap='Blues', alpha=0.15)", "href": "sources/basic.scatter_regression/original.html#L28" }, { "line": 29, "end_line": 29, "code": "ax_main.contour(Xg, Yg, Z, levels=5, colors=PALETTE[0], alpha=0.2, linewidths=0.5)", "href": "sources/basic.scatter_regression/original.html#L29" }, { "line": 32, "end_line": 32, "code": "ax_main.scatter(x, y, s=30, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.5, zorder=3)", "href": "sources/basic.scatter_regression/original.html#L32" }, { "line": 42, "end_line": 44, "code": " ax_main.fill_between(x_fit, p(x_fit) - 1.96 * se * (0.3 + layer * 0.1),\n p(x_fit) + 1.96 * se * (0.3 + layer * 0.1),\n alpha=alpha, color=PALETTE[1], linewidth=0)", "href": "sources/basic.scatter_regression/original.html#L42" }, { "line": 56, "end_line": 56, "code": "ax_top.fill_between(xd, kde_x(xd), alpha=0.2, color=PALETTE[0])", "href": "sources/basic.scatter_regression/original.html#L56" }, { "line": 67, "end_line": 67, "code": "ax_right.fill_betweenx(yd, kde_y(yd), alpha=0.2, color=PALETTE[0])", "href": "sources/basic.scatter_regression/original.html#L67" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.heatmap", "display_name": "带双侧树状图的下三角相关矩阵", "tags": [ "关联", "矩阵", "聚类" ], "purpose": "变量两两相关及相近结构怎样?", "data_requirements": [ "样本×连续变量矩阵", "变量标签" ], "composition": "下三角热力图;顶部及左侧树状图;右侧色条", "visual_features": [ "红蓝发散色阶", "白色上三角", "格内数值" ], "adaptation_notes": "当前树叶顺序未同步重排相关矩阵;左侧树线邻近标签。用于选结构时需知道这些原示例限制。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 5, "kind": "recipe", "legacy_title": "热力图(fig.add_axes 手动布局 + 聚类树状图 + 下三角遮罩 + 分组色条)", "legacy_ref": "basic #5", "source": { "original_code": "sources/basic.heatmap/original.py", "execution_code": "sources/basic.heatmap/render.py", "recipe_section": "sources/basic.heatmap/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "fa4d50510449fe4b5ffc7db3ba3878ddd0762191e0bbe1779e072b86764246f6", "code_sha256": "1e6abb73ec44f5e2818fd49092f67c7e8688617cf61634215cac512ae8f34b6a", "execution_sha256": "1e6abb73ec44f5e2818fd49092f67c7e8688617cf61634215cac512ae8f34b6a", "code_view": "sources/basic.heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.heatmap-1.png", "thumbnail": "thumbnails/basic.heatmap-1.jpg", "sha256": "b2319b8cf41f10c0d79987442c339d9a37e03eff49b1a00684bf4889d5086141", "pixels": [ 1420, 1334 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 24, "operation": "dendrogram", "code": "dn = dendrogram(Z, ax=ax_dtop, no_labels=True, color_threshold=0," }, { "line": 33, "operation": "dendrogram", "code": "dendrogram(Z, ax=ax_dleft, orientation='left', no_labels=True," }, { "line": 45, "operation": "imshow", "code": "im = ax_heat.imshow(corr_masked, cmap=palette_cmap('diverging'), vmin=-1, vmax=1, aspect='auto')" }, { "line": 63, "operation": "add_patch", "code": "ax_heat.add_patch(plt.Rectangle((j - 0.5, i - 0.5), 1, 1, fill=True," } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.pair_plot", "template.sem_violin_pearson", "empirical.correlation_heatmap", "competition.correlation_matrix" ], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.heatmap.md", "fidelity_checkpoints": [ { "feature": "聚类与遮罩下三角", "preserve": "保留树状图对应的变量重排、下三角遮罩、数值与色条;相关使用发散映射。", "allowed_adaptation": "变量数量、排序、字体和发散色相可变;无数据处与零相关区分。", "evidence": [ { "line": 45, "end_line": 45, "code": "im = ax_heat.imshow(corr_masked, cmap=palette_cmap('diverging'), vmin=-1, vmax=1, aspect='auto')", "href": "sources/basic.heatmap/original.html#L45" }, { "line": 63, "end_line": 64, "code": " ax_heat.add_patch(plt.Rectangle((j - 0.5, i - 0.5), 1, 1, fill=True,\n facecolor='white', edgecolor='white', zorder=2))", "href": "sources/basic.heatmap/original.html#L63" }, { "line": 66, "end_line": 66, "code": "fig.colorbar(im, ax=ax_heat, shrink=0.6, label='相关系数', pad=0.08)", "href": "sources/basic.heatmap/original.html#L66" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.donut", "display_name": "环形构成图", "tags": [ "组成" ], "purpose": "少量类别占整体多少,各自变化多少?", "data_requirements": [ "非负分量", "类别名", "可选同比或变化值" ], "composition": "单面板圆环;中心摘要;外置引线标签", "visual_features": [ "浅色扇区", "同色描边", "白色分隔", "中心留白" ], "adaptation_notes": "类别过多或占比接近时难精确比较;变化率是另一个输入,不由当前占比自动得到。", "number": 6, "kind": "recipe", "legacy_title": "环形图(淡色填充 + 原色边框 + 外部连线标签 + 变化率标注)", "legacy_ref": "basic #6", "source": { "original_code": "sources/basic.donut/original.py", "execution_code": "sources/basic.donut/render.py", "recipe_section": "sources/basic.donut/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "eae515dc7667ab2c72c8b3b14c02e918458fb52b0a75f25cd7f590ec2a61763a", "code_sha256": "00c679853d4b80d3fde20e4c8be4a45e382633ef6556d3855f99d2ec2ed23fe7", "execution_sha256": "00c679853d4b80d3fde20e4c8be4a45e382633ef6556d3855f99d2ec2ed23fe7", "code_view": "sources/basic.donut/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.donut-1.png", "thumbnail": "thumbnails/basic.donut-1.jpg", "sha256": "650c063d02d907c59fe06342fa6551f42c649d300f872557b7598c378da1ad6f", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 37, "operation": "plot", "code": " ax.plot([x_conn, x_label], [y_conn, y_label], '-', color=PALETTE[i], linewidth=0.8, alpha=0.6)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.donut.md", "fidelity_checkpoints": [ { "feature": "浅扇区和环形留白", "preserve": "保留浅扇区、独立深描边、环宽形成的中心留白及外置引线标签,不改成实心饼。", "allowed_adaptation": "类别、扇区角度、引线位置随真实占比变化;中心摘要与变化标签必须有依据。", "evidence": [ { "line": 17, "end_line": 21, "code": "wedges, texts = ax.pie(\n sizes, labels=None, startangle=90,\n colors=wedge_colors, explode=explode,\n wedgeprops=dict(width=0.45, edgecolor='white', linewidth=0),\n pctdistance=0.75)", "href": "sources/basic.donut/original.html#L17" }, { "line": 25, "end_line": 25, "code": " wedge.set_edgecolor(ec)", "href": "sources/basic.donut/original.html#L25" }, { "line": 37, "end_line": 38, "code": " ax.plot([x_conn, x_label], [y_conn, y_label], '-', color=PALETTE[i],\n linewidth=0.8, alpha=0.6)", "href": "sources/basic.donut/original.html#L37" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.raincloud", "display_name": "竖向雨云分布组合", "tags": [ "分布", "比较", "组合" ], "purpose": "各组样本的中心、离散与密度形状如何?", "data_requirements": [ "分组标签与每组原始连续样本" ], "composition": "每组左散点、中窄箱、右半小提琴", "visual_features": [ "六层透明半小提琴", "白边均值菱形", "错位排列" ], "adaptation_notes": "六层叠加而非连续渐变;小样本、常量或重复值很多时密度形状需谨慎适配。", "number": 7, "kind": "recipe", "legacy_title": "Rain Cloud 图(淡色填充 + 原色边框 + 半小提琴 + 箱线 + 抖动散点 + 均值菱形)", "legacy_ref": "basic #7", "source": { "original_code": "sources/basic.raincloud/original.py", "execution_code": "sources/basic.raincloud/render.py", "recipe_section": "sources/basic.raincloud/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "f697562bc38440f3d61828b60ee857a44c24eae5af2d6a9477a64890797dbc93", "code_sha256": "d169c2e5e12b66fde12a76ed1cf025a15292b4e0519ff2a756ee6db6e797661e", "execution_sha256": "d169c2e5e12b66fde12a76ed1cf025a15292b4e0519ff2a756ee6db6e797661e", "code_view": "sources/basic.raincloud/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.raincloud-1.png", "thumbnail": "thumbnails/basic.raincloud-1.jpg", "sha256": "661c6e74f810849542804bdc6e6b8b5b3cc44e66f809f5f4e983a67431d90625", "pixels": [ 1440, 1044 ], "native_inches": [ 8.0, 5.8 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 28, "operation": "fill_betweenx", "code": " ax.fill_betweenx(yr, pos + frac * 0.02, pos + density_norm * (1 - frac * 0.12), alpha=alpha, color=PALETTE[i], linewidth=0)" }, { "line": 31, "operation": "plot", "code": " ax.plot(pos + density_norm, yr, color=PALETTE[i], linewidth=1.2, alpha=0.8)" }, { "line": 34, "operation": "boxplot", "code": " bp = ax.boxplot(d, positions=[pos - 0.18], widths=0.12, vert=True, patch_artist=True, boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2), medianprops=dict(color=COLORS['text'], linewidth=1.8)," }, { "line": 44, "operation": "scatter", "code": " ax.scatter(pos - 0.38 + jitter, d, s=6, alpha=0.2, color=PALETTE[i], edgecolor='none')" }, { "line": 47, "operation": "scatter", "code": " ax.scatter(pos - 0.18, d.mean(), marker='D', s=45, color=PALETTE[i], edgecolor='white', linewidth=1.2, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "raincloud", "雨云图", "半小提琴", "箱线散点组合" ], "related_ids": [ "basic.raincloud_violin", "advanced.grouped_violin", "advanced.ridgeline", "empirical.raincloud", "academic.confusion_matrix", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.raincloud.md", "fidelity_checkpoints": [ { "feature": "六层半密度与深轮廓", "preserve": "保留六层填充的偏移、收缩和 alpha 计算,以及最外侧独立轮廓;不压成一片纯色。", "allowed_adaptation": "由真实组样本计算密度,可调带宽和宽度;检查小样本、常量组是否支持 KDE。", "evidence": [ { "line": 20, "end_line": 31, "code": " kde = gaussian_kde(d, bw_method=0.3)\n yr = np.linspace(d.min() - 4, d.max() + 4, 300)\n density = kde(yr)\n density_norm = density / density.max() * 0.35\n\n for layer in range(6):\n frac = layer / 6\n alpha = 0.35 - frac * 0.05\n ax.fill_betweenx(yr, pos + frac * 0.02, pos + density_norm * (1 - frac * 0.12),\n alpha=alpha, color=PALETTE[i], linewidth=0)\n # 原色边框轮廓\n ax.plot(pos + density_norm, yr, color=PALETTE[i], linewidth=1.2, alpha=0.8)", "href": "sources/basic.raincloud/original.html#L20" } ] }, { "feature": "散点、窄箱、半小提琴错位", "preserve": "沿横向保留左散点、中窄箱、右半小提琴关系和白边均值菱形;箱体保留浅填充与深描边。", "allowed_adaptation": "组数、间距、点密度和标签可调,均值由当前样本计算,不固定示例偏移量。", "evidence": [ { "line": 34, "end_line": 48, "code": " bp = ax.boxplot(d, positions=[pos - 0.18], widths=0.12, vert=True, patch_artist=True,\n boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4),\n edgecolor=PALETTE[i], linewidth=1.2),\n medianprops=dict(color=COLORS['text'], linewidth=1.8),\n whiskerprops=dict(linewidth=1, color=PALETTE[i]),\n capprops=dict(linewidth=1, color=COLORS['ref_line']),\n flierprops=dict(marker='', markersize=0))\n\n # 抖动散点(最左侧)\n jitter = np.random.uniform(-0.08, 0.08, len(d))\n ax.scatter(pos - 0.38 + jitter, d, s=6, alpha=0.2, color=PALETTE[i], edgecolor='none')\n\n # 均值菱形\n ax.scatter(pos - 0.18, d.mean(), marker='D', s=45, color=PALETTE[i],\n edgecolor='white', linewidth=1.2, zorder=5)", "href": "sources/basic.raincloud/original.html#L34" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.area", "display_name": "堆叠面积与事件标记", "tags": [ "组成", "趋势" ], "purpose": "组成份额如何随时间转移?", "data_requirements": [ "有序时间", "各组成分量", "事件日期" ], "composition": "单面板累计面积堆叠;事件竖线", "visual_features": [ "三层近重合填充", "顶部轮廓", "末端占比标签" ], "adaptation_notes": "主要区域近似纯色,深浅变化集中在边缘;百分比数据需保证每期加总口径一致。", "number": 8, "kind": "recipe", "legacy_title": "面积图(渐变填充 + 事件标记线 + 端点标注)", "legacy_ref": "basic #8", "source": { "original_code": "sources/basic.area/original.py", "execution_code": "sources/basic.area/render.py", "recipe_section": "sources/basic.area/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "7774e2f13449e166049595e88bd1634058978e7e19735678328fceda4cc7a67e", "code_sha256": "d991f80ab18ed5a439da7880fa5b2679eafe33b64fd5dfc19359e31f0910c5b3", "execution_sha256": "d991f80ab18ed5a439da7880fa5b2679eafe33b64fd5dfc19359e31f0910c5b3", "code_view": "sources/basic.area/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.area-1.png", "thumbnail": "thumbnails/basic.area-1.jpg", "sha256": "6393e16b64855f527054d8c1ddf5a2588e0d7ade88d53b8734b557a939586754", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "fill_between", "code": " ax.fill_between(years, cumsum + layer * 0.3, cumsum + vals - layer * 0.3, alpha=alpha, color=PALETTE[i], linewidth=0)" }, { "line": 23, "operation": "plot", "code": " ax.plot(years, cumsum + vals, color=PALETTE[i], linewidth=1.5, alpha=0.8, label=name)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.streamgraph", "empirical.variance_decomposition" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.area.md", "fidelity_checkpoints": [ { "feature": "三层叠加与累计轮廓", "preserve": "保留近重合的三层填充及每成分顶部独立轮廓;累计上下边界随成分递增,不以单片不透明面积代替。", "allowed_adaptation": "成分数与实际规模可变,内缩量按量纲调整以避免薄成分翻转;事件线仅标真实事件。", "evidence": [ { "line": 20, "end_line": 21, "code": " ax.fill_between(years, cumsum + layer * 0.3, cumsum + vals - layer * 0.3,\n alpha=alpha, color=PALETTE[i], linewidth=0)", "href": "sources/basic.area/original.html#L20" }, { "line": 23, "end_line": 23, "code": " ax.plot(years, cumsum + vals, color=PALETTE[i], linewidth=1.5, alpha=0.8, label=name)", "href": "sources/basic.area/original.html#L23" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.pareto", "display_name": "贡献排序与累计占比", "tags": [ "排序", "组成", "组合" ], "purpose": "哪些少数因素贡献了大部分总量?", "data_requirements": [ "非负类别贡献值" ], "composition": "降序柱图;右轴累计百分比曲线", "visual_features": [ "重点柱加深", "80%阈值", "贡献区域浅阴影" ], "adaptation_notes": "这是贡献累计图,不是多目标优化Pareto前沿;累计占比要求总量为正。", "number": 9, "kind": "recipe", "legacy_title": "竖向帕累托图(柱状图 + 累积百分比折线 + 80% 分界线)", "legacy_ref": "basic #9", "source": { "original_code": "sources/basic.pareto/original.py", "execution_code": "sources/basic.pareto/render.py", "recipe_section": "sources/basic.pareto/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "ccbcdd63f06f7f8d6969bf199cbf6d5cf964e0858c35dbf114a65d688e1f103c", "code_sha256": "e27ee23136df5b938032cbcd560da591ba0dc034a197cc530e6439223885d618", "execution_sha256": "e27ee23136df5b938032cbcd560da591ba0dc034a197cc530e6439223885d618", "code_view": "sources/basic.pareto/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.pareto-1.png", "thumbnail": "thumbnails/basic.pareto-1.jpg", "sha256": "e74877ae89659a8f241742f1d9ebbc0dabaa37e22e06a71ded1030ed5544cd62", "pixels": [ 1620, 990 ], "native_inches": [ 9.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "bar", "code": "bars = ax1.bar(x, values, width=0.6, color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0], linewidth=1.2, zorder=2)" }, { "line": 38, "operation": "plot", "code": "ax2.plot(x, cumulative_pct, 'o-', color=PALETTE[1], linewidth=2, markersize=6, markeredgecolor='white', markeredgewidth=1.2, zorder=3)" } ], "literal_colormaps": [], "aliases": [ "贡献累计", "80/20" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.pareto.md", "fidelity_checkpoints": [ { "feature": "贡献柱和累计曲线", "preserve": "保留浅柱深边、重点柱加深、累计百分比曲线与贡献区域浅阴影。", "allowed_adaptation": "按当前贡献值排序并重算累计占比;阈值按问题设定,标签空间可调。", "evidence": [ { "line": 21, "end_line": 23, "code": "bars = ax1.bar(x, values, width=0.6,\n color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0],\n linewidth=1.2, zorder=2)", "href": "sources/basic.pareto/original.html#L21" }, { "line": 28, "end_line": 28, "code": " bars[i].set_facecolor(_lighten(PALETTE[0], 0.25))", "href": "sources/basic.pareto/original.html#L28" }, { "line": 38, "end_line": 39, "code": "ax2.plot(x, cumulative_pct, 'o-', color=PALETTE[1], linewidth=2, markersize=6,\n markeredgecolor='white', markeredgewidth=1.2, zorder=3)", "href": "sources/basic.pareto/original.html#L38" }, { "line": 49, "end_line": 49, "code": "ax1.axvspan(-0.5, threshold_idx + 0.5, alpha=0.05, color=PALETTE[0], zorder=0)", "href": "sources/basic.pareto/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.dual_axis", "display_name": "柱线双轴组合", "tags": [ "趋势", "比较", "组合" ], "purpose": "总量与另一项不同单位指标如何共同变化?", "data_requirements": [ "同一时间轴", "两组数值" ], "composition": "左轴柱;右轴折线和填充", "visual_features": [ "浅柱描边", "三层折线下填充", "峰值高亮", "相关框" ], "adaptation_notes": "双轴缩放会影响观感;三层填充并非连续渐变;相关不代表因果。", "number": 10, "kind": "recipe", "legacy_title": "双轴图(淡色填充 + 原色边框柱 + 渐变填充折线 + 相关性标注框 + 峰值高亮)", "legacy_ref": "basic #10", "source": { "original_code": "sources/basic.dual_axis/original.py", "execution_code": "sources/basic.dual_axis/render.py", "recipe_section": "sources/basic.dual_axis/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "74dcf691b770b07628a265955da77e0772b24aab9632fd4071b6f78cc25104a6", "code_sha256": "d309b40f1b881300f92b7e5a0493f774a07e12300ee91b023ff9bf4e76675924", "execution_sha256": "d309b40f1b881300f92b7e5a0493f774a07e12300ee91b023ff9bf4e76675924", "code_view": "sources/basic.dual_axis/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.dual_axis-1.png", "thumbnail": "thumbnails/basic.dual_axis-1.jpg", "sha256": "4d3f390fbc1b0cdaf9f4fda915e51a720c8c088628b6ece0870152f369a27d8d", "pixels": [ 1440, 990 ], "native_inches": [ 8.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 14, "operation": "bar", "code": "bars = ax1.bar(years, bar_data, width=0.6, color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0], linewidth=1.2, label='数量', zorder=2)" }, { "line": 19, "operation": "bar", "code": "ax1.bar(years + 0.03, bar_data, width=0.6, color='#cccccc', alpha=0.08, zorder=1)" }, { "line": 22, "operation": "plot", "code": "line = ax2.plot(years, line_data, 'o-', color=PALETTE[1], linewidth=2.2, markersize=7, markeredgecolor='white', markeredgewidth=1.2, label='增长率', zorder=5)" }, { "line": 25, "operation": "fill_between", "code": " ax2.fill_between(years, min(line_data) - 2 + layer * 0.5, np.array(line_data) - layer * 0.5, alpha=alpha, color=PALETTE[1], linewidth=0)" }, { "line": 31, "operation": "scatter", "code": "ax2.scatter(years[peak_idx], line_data[peak_idx], s=150, color=PALETTE[1], edgecolor='white', linewidth=2.5, zorder=6)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.dual_axis.md", "fidelity_checkpoints": [ { "feature": "双轴浅柱与分层曲线填充", "preserve": "保留两轴的柱与折线区分、浅柱深边和阴影、三层折线下填充及白边峰值。", "allowed_adaptation": "两轴单位与刻度分别适配,填充基线随数据范围调整;相关摘要重新计算。", "evidence": [ { "line": 14, "end_line": 16, "code": "bars = ax1.bar(years, bar_data, width=0.6,\n color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0],\n linewidth=1.2, label='数量', zorder=2)", "href": "sources/basic.dual_axis/original.html#L14" }, { "line": 19, "end_line": 19, "code": "ax1.bar(years + 0.03, bar_data, width=0.6, color='#cccccc', alpha=0.08, zorder=1)", "href": "sources/basic.dual_axis/original.html#L19" }, { "line": 22, "end_line": 23, "code": "line = ax2.plot(years, line_data, 'o-', color=PALETTE[1], linewidth=2.2, markersize=7,\n markeredgecolor='white', markeredgewidth=1.2, label='增长率', zorder=5)", "href": "sources/basic.dual_axis/original.html#L22" }, { "line": 25, "end_line": 27, "code": " ax2.fill_between(years, min(line_data) - 2 + layer * 0.5,\n np.array(line_data) - layer * 0.5,\n alpha=alpha, color=PALETTE[1], linewidth=0)", "href": "sources/basic.dual_axis/original.html#L25" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.raincloud_violin", "display_name": "完整小提琴与箱线显著性比较", "tags": [ "分布", "比较", "组合" ], "purpose": "多组分布差异及组间检验结果如何?", "data_requirements": [ "各组原始连续样本", "分组标签" ], "composition": "竖向对称小提琴;内部窄箱;顶部检验括号", "visual_features": [ "浅色琴体与轮廓", "均值菱形", "显著性括号" ], "adaptation_notes": "实际无独立抖动散点,区别于半小提琴雨云图;检验方法和多重比较需匹配任务。", "number": 11, "kind": "recipe", "legacy_title": "Rain Cloud 小提琴图(淡色填充 + 原色边框 + 显著性括号 + 完整分布展示)", "legacy_ref": "basic #11", "source": { "original_code": "sources/basic.raincloud_violin/original.py", "execution_code": "sources/basic.raincloud_violin/render.py", "recipe_section": "sources/basic.raincloud_violin/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "a21c296fdddba5d1ec610e0d3e37fafd6e4c6644a928b5323882eb9e0ac02bc8", "code_sha256": "935ccf183ecadc7e480d902e6ad54f6ae45d456feb2f43d1063f8f732e744d61", "execution_sha256": "935ccf183ecadc7e480d902e6ad54f6ae45d456feb2f43d1063f8f732e744d61", "code_view": "sources/basic.raincloud_violin/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.raincloud_violin-1.png", "thumbnail": "thumbnails/basic.raincloud_violin-1.jpg", "sha256": "2b796d9df8e9d00eddd6dab9a5bc3a122e2e517335bc5996ecda5d577c08e440", "pixels": [ 1440, 990 ], "native_inches": [ 8.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 14, "operation": "violinplot", "code": "parts = ax.violinplot(data, positions=range(len(groups)), showmeans=False, showmedians=False, showextrema=False)" }, { "line": 24, "operation": "boxplot", "code": "bp = ax.boxplot(data, positions=range(len(groups)), widths=0.15, patch_artist=True, boxprops=dict(facecolor='white', edgecolor=COLORS['text'], linewidth=1.2), medianprops=dict(color=COLORS['text'], linewidth=2), whiskerprops=dict(linewidth=1.2)," }, { "line": 33, "operation": "scatter", "code": " ax.scatter(i, d.mean(), marker='D', s=40, color=PALETTE[i], edgecolor='white', linewidth=1, zorder=5)" }, { "line": 42, "operation": "plot", "code": " ax.plot([x1, x1, x2, x2], [y, y + h, y + h, y], color=COLORS['text'], linewidth=0.8)" } ], "literal_colormaps": [], "aliases": [ "violin", "小提琴箱线组合" ], "related_ids": [ "basic.raincloud", "advanced.grouped_violin", "advanced.ridgeline", "empirical.raincloud", "academic.confusion_matrix", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.raincloud_violin.md", "fidelity_checkpoints": [ { "feature": "对称琴体与内部窄箱", "preserve": "保留浅色半透明对称琴体、深轮廓、内部窄箱与均值菱形;不是左右错位的半雨云。", "allowed_adaptation": "组数与间距可变;箱线和均值由样本计算,比较括号只用于有效检验。", "evidence": [ { "line": 14, "end_line": 15, "code": "parts = ax.violinplot(data, positions=range(len(groups)), showmeans=False,\n showmedians=False, showextrema=False)", "href": "sources/basic.raincloud_violin/original.html#L14" }, { "line": 21, "end_line": 21, "code": " pc.set_alpha(0.7)", "href": "sources/basic.raincloud_violin/original.html#L21" }, { "line": 24, "end_line": 29, "code": "bp = ax.boxplot(data, positions=range(len(groups)), widths=0.15, patch_artist=True,\n boxprops=dict(facecolor='white', edgecolor=COLORS['text'], linewidth=1.2),\n medianprops=dict(color=COLORS['text'], linewidth=2),\n whiskerprops=dict(linewidth=1.2),\n capprops=dict(linewidth=1.2),\n flierprops=dict(marker='.', markersize=3, alpha=0.3))", "href": "sources/basic.raincloud_violin/original.html#L24" }, { "line": 33, "end_line": 34, "code": " ax.scatter(i, d.mean(), marker='D', s=40, color=PALETTE[i],\n edgecolor='white', linewidth=1, zorder=5)", "href": "sources/basic.raincloud_violin/original.html#L33" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "basic.multipanel", "display_name": "折线柱状散点直方四面板", "tags": [ "组合", "趋势", "比较", "分布" ], "purpose": "怎样在一页给出四种互补概览?", "data_requirements": [ "趋势序列、类别数值、配对样本和分组分布" ], "composition": "2×2:折线、分组柱、散点、直方图", "visual_features": [ "统一浅填充与点形", "紧凑子图标签" ], "adaptation_notes": "示例四组数据相互独立;左上仅单层色带,左下未实际绘制注释所称KDE;组合语义需来自实际任务。", "number": 12, "kind": "recipe", "legacy_title": "多面板子图(淡色填充 + 原色边框 + 带背景框标签 + 统一风格)", "legacy_ref": "basic #12", "source": { "original_code": "sources/basic.multipanel/original.py", "execution_code": "sources/basic.multipanel/render.py", "recipe_section": "sources/basic.multipanel/recipe.md", "recipe_file": "figure_recipes_basic.md", "content_sha256": "8ef93b1f5debf3b14fb81395cbb353d127f3ad19edf0f1ad23b7f7d0738c2a94", "code_sha256": "e60a5cad9d4cd5106c6067eee66913276fa45af1b5998ac31ed9e82640577faa", "execution_sha256": "e60a5cad9d4cd5106c6067eee66913276fa45af1b5998ac31ed9e82640577faa", "code_view": "sources/basic.multipanel/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/basic.multipanel-1.png", "thumbnail": "thumbnails/basic.multipanel-1.jpg", "sha256": "43a96d575b503eae2ccdb1842a168a5a30655c77e8ffd99e1f6037f6987c2a17", "pixels": [ 900, 882 ], "native_inches": [ 5.0, 4.9 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 13, "operation": "plot", "code": " ax.plot(range(10), y, 'o-', color=PALETTE[i], linewidth=1.8, markersize=5, markeredgecolor='white', markeredgewidth=0.8, label=f'系列{i + 1}')" }, { "line": 15, "operation": "fill_between", "code": " ax.fill_between(range(10), y - 1, y + 1, alpha=0.08, color=PALETTE[i])" }, { "line": 28, "operation": "bar", "code": " ax.bar(x + offset, vals, 0.28, color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2, label=label)" }, { "line": 40, "operation": "scatter", "code": " ax.scatter(pts[:, 0], pts[:, 1], s=25, alpha=0.6, color=PALETTE[i], edgecolor='white', linewidth=0.5, label=f'类{i + 1}')" }, { "line": 51, "operation": "hist", "code": " ax.hist(vals, bins=20, alpha=0.5, color=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=0.8, label=f'分布{i + 1}')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/basic.multipanel.md", "fidelity_checkpoints": [ { "feature": "四面板共用视觉语言", "preserve": "保留折线带、浅柱深边、透明散点和半透明直方的面板差异及共用样式,不各面板另起风格。", "allowed_adaptation": "版面尺寸与数据规模可调;面板是否保留按表达目的决定,不能造区间补结构。", "evidence": [ { "line": 13, "end_line": 14, "code": " ax.plot(range(10), y, 'o-', color=PALETTE[i], linewidth=1.8, markersize=5,\n markeredgecolor='white', markeredgewidth=0.8, label=f'系列{i + 1}')", "href": "sources/basic.multipanel/original.html#L13" }, { "line": 15, "end_line": 15, "code": " ax.fill_between(range(10), y - 1, y + 1, alpha=0.08, color=PALETTE[i])", "href": "sources/basic.multipanel/original.html#L15" }, { "line": 28, "end_line": 29, "code": " ax.bar(x + offset, vals, 0.28, color=_lighten(PALETTE[i], 0.4),\n edgecolor=PALETTE[i], linewidth=1.2, label=label)", "href": "sources/basic.multipanel/original.html#L28" }, { "line": 40, "end_line": 41, "code": " ax.scatter(pts[:, 0], pts[:, 1], s=25, alpha=0.6, color=PALETTE[i],\n edgecolor='white', linewidth=0.5, label=f'类{i + 1}')", "href": "sources/basic.multipanel/original.html#L40" }, { "line": 51, "end_line": 52, "code": " ax.hist(vals, bins=20, alpha=0.5, color=_lighten(PALETTE[i], 0.4),\n edgecolor=PALETTE[i], linewidth=0.8, label=f'分布{i + 1}')", "href": "sources/basic.multipanel/original.html#L51" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.lollipop", "display_name": "排名棒棒糖与徽章", "tags": [ "排序", "比较" ], "purpose": "少量方法得分如何排序并突出领先者?", "data_requirements": [ "类别名称与单项得分" ], "composition": "横向棒棒糖;左端排名徽章", "visual_features": [ "类别间紫到珊瑚色过渡", "线宽和点大小映射分数", "中位线" ], "adaptation_notes": "单根线和点内部不是渐变;前三名圆徽章使用数据坐标,预览呈横向拉伸;不预判此设计必须修正。", "number": 13, "kind": "recipe", "legacy_title": "Lollipop Chart — 棒棒糖图(渐变色茎 + 排名徽章 + 中位数参考线)", "legacy_ref": "advanced #1", "source": { "original_code": "sources/advanced.lollipop/original.py", "execution_code": "sources/advanced.lollipop/render.py", "recipe_section": "sources/advanced.lollipop/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "525f7a12e43de4af7e1669772279337f442d139a60a18b1caefcdca188642a15", "code_sha256": "fe3dd8ae034c80ccb83faf5193594371e81c0bcfb48795997a468f55cff4b9a2", "execution_sha256": "02a18445f9692879955d97c7d4b1baa4823b73947e01ab6569d49c2475c5baa7", "code_view": "sources/advanced.lollipop/original.html" }, "title_mismatch": false, "compatibility_patches": [ "RGB 元组转十六进制以适配原 _lighten 接口,颜色含义不变" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.lollipop-1.png", "thumbnail": "thumbnails/advanced.lollipop-1.jpg", "sha256": "cb5a50d827ab9230be77d9dbdb5e15bc3c4168e686a13bb4d9ebe0847cd2babc", "pixels": [ 1350, 738 ], "native_inches": [ 7.5, 4.1000000000000005 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 55, "operation": "plot", "code": " ax.plot([0, s], [y_pos[i], y_pos[i]], color=c, linewidth=lw, zorder=3, solid_capstyle='round')" }, { "line": 60, "operation": "scatter", "code": " ax.scatter(s, y_pos[i], color=c, s=dot_size, zorder=5, edgecolors='white', linewidths=1.8)" }, { "line": 75, "operation": "add_patch", "code": " ax.add_patch(badge)" } ], "literal_colormaps": [], "aliases": [ "lollipop", "横向排名" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.lollipop.md", "fidelity_checkpoints": [ { "feature": "排名徽章与强度映射", "preserve": "保留颜色随排名过渡、线宽和点面积随分数变化、白边端点与排名徽章;不要变成同宽同色的普通棒棒糖。", "allowed_adaptation": "得分、名次及徽章数量据实更新,色相可替换但保留过渡;长名称可增加左边距。", "evidence": [ { "line": 46, "end_line": 46, "code": "ax.axvline(median_val, color=COLORS['ref_line'], linestyle=':', linewidth=1.0, alpha=0.5, zorder=1)", "href": "sources/advanced.lollipop/original.html#L46" }, { "line": 55, "end_line": 56, "code": " ax.plot([0, s], [y_pos[i], y_pos[i]],\n color=c, linewidth=lw, zorder=3, solid_capstyle='round')", "href": "sources/advanced.lollipop/original.html#L55" }, { "line": 60, "end_line": 61, "code": " ax.scatter(s, y_pos[i], color=c, s=dot_size, zorder=5,\n edgecolors='white', linewidths=1.8)", "href": "sources/advanced.lollipop/original.html#L60" }, { "line": 75, "end_line": 75, "code": " ax.add_patch(badge)", "href": "sources/advanced.lollipop/original.html#L75" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.dumbbell", "display_name": "前后对比哑铃图", "tags": [ "比较", "变化" ], "purpose": "每个指标改善或下降了多少?", "data_requirements": [ "各指标前后值", "可选变化率与显著性结果" ], "composition": "每行两个端点;细连接线和箭头", "visual_features": [ "两端对比色", "右侧增量", "简洁共享数轴" ], "adaptation_notes": "这是汇总值对比,不显示个体配对分布;预览末行标签靠近右下图例。", "number": 14, "kind": "recipe", "legacy_title": "Dumbbell Chart — 哑铃图(连接线 + 变化率 + 显著性标记)", "legacy_ref": "advanced #2", "source": { "original_code": "sources/advanced.dumbbell/original.py", "execution_code": "sources/advanced.dumbbell/render.py", "recipe_section": "sources/advanced.dumbbell/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "67271d7827dc9ece296a81ca165374f41a5e6723b55562298370adcbff760dd5", "code_sha256": "3066ec5c2f58402686b33db8ecbe7dd9d73abfe0cb612a23a59fb14342c16eb4", "execution_sha256": "3066ec5c2f58402686b33db8ecbe7dd9d73abfe0cb612a23a59fb14342c16eb4", "code_view": "sources/advanced.dumbbell/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.dumbbell-1.png", "thumbnail": "thumbnails/advanced.dumbbell-1.jpg", "sha256": "169437e183ad8db59bd9a8c85e05cd3308924b89fbb10ecdb76635efb975060b", "pixels": [ 1440, 810 ], "native_inches": [ 8.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 24, "operation": "plot", "code": " ax.plot([before[i], after[i]], [y[i], y[i]], color=PALETTE[2], linewidth=2.0, solid_capstyle='round')" }, { "line": 31, "operation": "scatter", "code": " ax.scatter(before[i], y[i], color=PALETTE[3], s=80, zorder=3, edgecolors='white', linewidths=1.0, label='Before' if i == 0 else '')" }, { "line": 33, "operation": "scatter", "code": " ax.scatter(after[i], y[i], color=PALETTE[0], s=80, zorder=3, edgecolors='white', linewidths=1.0, label='After' if i == 0 else '')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.paired_dot", "advanced.slope", "advanced.bump" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.dumbbell.md", "fidelity_checkpoints": [ { "feature": "两端点、连接与变化", "preserve": "保留两端颜色区分、白边点、连接线及方向箭头;变化文字与两端同一数轴对齐。", "allowed_adaptation": "对象数量、间距和标注偏移可调,正负方向和变化率按数据更新。", "evidence": [ { "line": 24, "end_line": 25, "code": " ax.plot([before[i], after[i]], [y[i], y[i]],\n color=PALETTE[2], linewidth=2.0, solid_capstyle='round')", "href": "sources/advanced.dumbbell/original.html#L24" }, { "line": 27, "end_line": 28, "code": " ax.annotate('', xy=(after[i], y[i]), xytext=(after[i] - 0.012, y[i]),\n arrowprops=dict(arrowstyle='->', color=PALETTE[0], lw=2.0))", "href": "sources/advanced.dumbbell/original.html#L27" }, { "line": 31, "end_line": 32, "code": " ax.scatter(before[i], y[i], color=PALETTE[3], s=80, zorder=3,\n edgecolors='white', linewidths=1.0, label='Before' if i == 0 else '')", "href": "sources/advanced.dumbbell/original.html#L31" }, { "line": 33, "end_line": 34, "code": " ax.scatter(after[i], y[i], color=PALETTE[0], s=80, zorder=3,\n edgecolors='white', linewidths=1.0, label='After' if i == 0 else '')", "href": "sources/advanced.dumbbell/original.html#L33" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.slope", "display_name": "两阶段斜率与排名变化", "tags": [ "变化", "排序" ], "purpose": "两个阶段的方法得分与名次怎样变化?", "data_requirements": [ "类别在两个阶段的数值" ], "composition": "左右两端连线;端点名称与名次", "visual_features": [ "颜色区分类别", "斜率表达增减", "两侧数值标注" ], "adaptation_notes": "只覆盖两个阶段;类别多时交叉拥挤;不能把得分斜率当成连续时间轨迹。", "number": 15, "kind": "recipe", "legacy_title": "Slope Chart — 斜率图(颜色编码线 + 排名变化标注)", "legacy_ref": "advanced #3", "source": { "original_code": "sources/advanced.slope/original.py", "execution_code": "sources/advanced.slope/render.py", "recipe_section": "sources/advanced.slope/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "fd65b89d40567f7f3fc5fbed5056a00555c81b19d9a45f56fc9a30a35959d261", "code_sha256": "689fb80c0f324b5e77dccc8f45bd76c9298c36e5aa076039369383dcd497ae6c", "execution_sha256": "689fb80c0f324b5e77dccc8f45bd76c9298c36e5aa076039369383dcd497ae6c", "code_view": "sources/advanced.slope/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.slope-1.png", "thumbnail": "thumbnails/advanced.slope-1.jpg", "sha256": "e69845629ac5a16993e7849e1dd240d3e6158669399363586f61daec72d0d5a6", "pixels": [ 1080, 990 ], "native_inches": [ 6.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "plot", "code": " ax.plot([0, 1], [dataset1[i], dataset2[i]], color=base_color, linewidth=2.5, solid_capstyle='round')" }, { "line": 30, "operation": "scatter", "code": " ax.scatter([0], [dataset1[i]], color=base_color, s=90, zorder=5, edgecolors='white', linewidths=1.2)" }, { "line": 32, "operation": "scatter", "code": " ax.scatter([1], [dataset2[i]], color=base_color, s=90, zorder=5, edgecolors='white', linewidths=1.2)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.paired_dot", "advanced.dumbbell", "advanced.bump" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.slope.md", "fidelity_checkpoints": [ { "feature": "端点配对与两侧读数", "preserve": "保留逐对象两端连接、白边端点、左右数值与对象身份,不把配对关系改成均值趋势。", "allowed_adaptation": "左右两次测量与名次重新计算,标签可避让,保持同一可比尺度。", "evidence": [ { "line": 26, "end_line": 27, "code": " ax.plot([0, 1], [dataset1[i], dataset2[i]], color=base_color,\n linewidth=2.5, solid_capstyle='round')", "href": "sources/advanced.slope/original.html#L26" }, { "line": 30, "end_line": 31, "code": " ax.scatter([0], [dataset1[i]], color=base_color, s=90, zorder=5,\n edgecolors='white', linewidths=1.2)", "href": "sources/advanced.slope/original.html#L30" }, { "line": 32, "end_line": 33, "code": " ax.scatter([1], [dataset2[i]], color=base_color, s=90, zorder=5,\n edgecolors='white', linewidths=1.2)", "href": "sources/advanced.slope/original.html#L32" }, { "line": 36, "end_line": 37, "code": " ax.text(-0.08, dataset1[i], f'{dataset1[i]:.2f}', ha='right', va='center',\n fontsize=9, color=base_color)", "href": "sources/advanced.slope/original.html#L36" }, { "line": 38, "end_line": 39, "code": " ax.text(1.08, dataset2[i], f'{dataset2[i]:.2f}', ha='left', va='center',\n fontsize=9, color=base_color)", "href": "sources/advanced.slope/original.html#L38" }, { "line": 46, "end_line": 48, "code": " ax.text(1.22, dataset2[i], f'{m} {arrow_sym}{abs(rank_delta)}',\n ha='left', va='center', fontsize=8, color=rank_color,\n bbox=dict(boxstyle='round,pad=0.3', facecolor='white', edgecolor=rank_color, alpha=0.9))", "href": "sources/advanced.slope/original.html#L46" }, { "line": 50, "end_line": 51, "code": " ax.text(1.22, dataset2[i], f'{m} →', ha='left', va='center',\n fontsize=8, color=COLORS['ref_line'])", "href": "sources/advanced.slope/original.html#L50" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.bump", "display_name": "多阶段名次轨迹", "tags": [ "排序", "趋势" ], "purpose": "多个阶段谁领先,排名如何交换?", "data_requirements": [ "方法×阶段的名次或可转换为名次的表现" ], "composition": "横向阶段;纵向排名;多条名次折线", "visual_features": [ "主方法粗线与透明宽带", "两端名次标签" ], "adaptation_notes": "宽带是高亮,不是误差;名次间距不反映原得分差距。", "number": 16, "kind": "recipe", "legacy_title": "Bump Chart — 凹凸图(色带高亮 + 两端排名标签 + \"本文\"高亮)", "legacy_ref": "advanced #4", "source": { "original_code": "sources/advanced.bump/original.py", "execution_code": "sources/advanced.bump/render.py", "recipe_section": "sources/advanced.bump/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "62f242937b875dc85f871699ff0b9f76623f30bb46e96867355c62145b263b85", "code_sha256": "b08dc33ea8bcdf58c4367e49eecd41a6237b830bad8d5ba51453132072b30abd", "execution_sha256": "b08dc33ea8bcdf58c4367e49eecd41a6237b830bad8d5ba51453132072b30abd", "code_view": "sources/advanced.bump/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.bump-1.png", "thumbnail": "thumbnails/advanced.bump-1.jpg", "sha256": "080bdb918813e818891db2566fac5c929068e746826fdc1d2ac213ab7fd3aa47", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 28, "operation": "fill_between", "code": " ax.fill_between(x_fill, y_fill - 0.15, y_fill + 0.15, alpha=0.15, color=PALETTE[0])" }, { "line": 32, "operation": "plot", "code": " ax.plot(x, r, 'o-', color=PALETTE[i], linewidth=lw, markersize=ms, label=m, zorder=3 + (1 if is_ours else 0), alpha=alpha_line, markeredgecolor='white', markeredgewidth=1.5 if is_ours else 0.8)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.paired_dot", "advanced.dumbbell", "advanced.slope" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.bump.md", "fidelity_checkpoints": [ { "feature": "排名线的主次层次", "preserve": "保留主方法粗线、浅宽带和两端名次标签;宽带用于高亮名次路径,不能误标为统计置信区间。", "allowed_adaptation": "阶段、排名及主方法按数据替换;插值仅为连接视觉,不能改变实际阶段名次。", "evidence": [ { "line": 28, "end_line": 29, "code": " ax.fill_between(x_fill, y_fill - 0.15, y_fill + 0.15,\n alpha=0.15, color=PALETTE[0])", "href": "sources/advanced.bump/original.html#L28" }, { "line": 32, "end_line": 34, "code": " ax.plot(x, r, 'o-', color=PALETTE[i], linewidth=lw, markersize=ms,\n label=m, zorder=3 + (1 if is_ours else 0), alpha=alpha_line,\n markeredgecolor='white', markeredgewidth=1.5 if is_ours else 0.8)", "href": "sources/advanced.bump/original.html#L32" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.sankey", "display_name": "流量分配桑基图", "tags": [ "流向", "组成", "组合" ], "purpose": "资源或样本如何从来源分配到去向?", "data_requirements": [ "来源节点、目标节点及非负流量", "节点名称" ], "composition": "左右两列矩形节点;贝塞尔流带;包含多对一、一对多、多对多三个示例", "visual_features": [ "半透明宽带", "交叉叠色", "节点总量标签", "流量映射带宽" ], "adaptation_notes": "三个预览均来自同一完整代码块;需要核对各节点流量守恒;当前模板非任意多阶段网络布局器。", "number": 17, "kind": "recipe", "legacy_title": "Sankey Diagram — 桑基图(D3 风格,矩形节点 + 贝塞尔流带)", "legacy_ref": "advanced #5", "source": { "original_code": "sources/advanced.sankey/original.py", "execution_code": "sources/advanced.sankey/render.py", "recipe_section": "sources/advanced.sankey/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "2a394c5ff5bc4fd7631134af4a1263aee3346ac36a38f8e2a63b6fcb7714ae87", "code_sha256": "f5a6f75a166fdad6fb7bbf919fad4f8a1cace33d8d9239b171a9454959a0fb99", "execution_sha256": "f5a6f75a166fdad6fb7bbf919fad4f8a1cace33d8d9239b171a9454959a0fb99", "code_view": "sources/advanced.sankey/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.sankey-1.png", "thumbnail": "thumbnails/advanced.sankey-1.jpg", "sha256": "430dd5fdd671dca029d53e00fb2c3d8699c8f62a87e4cd003d0279630423798e", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] }, { "path": "previews/advanced.sankey-2.png", "thumbnail": "thumbnails/advanced.sankey-2.jpg", "sha256": "8e86c642f3b6a4a549a59fddc5221d8ca635a46627d791d483ded9ed24369c37", "pixels": [ 1800, 990 ], "native_inches": [ 10.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] }, { "path": "previews/advanced.sankey-3.png", "thumbnail": "thumbnails/advanced.sankey-3.jpg", "sha256": "a0bfd818f950ea3fa3c0fa1df332c7707736a236cd96607191af06aa696a6e4f", "pixels": [ 1890, 1080 ], "native_inches": [ 10.5, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 64, "operation": "add_patch", "code": " ax.add_patch(rect)" }, { "line": 74, "operation": "add_patch", "code": " ax.add_patch(rect)" }, { "line": 107, "operation": "add_patch", "code": " ax.add_patch(patch)" } ], "literal_colormaps": [], "aliases": [ "sankey", "流向图", "资源分配" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.sankey.md", "fidelity_checkpoints": [ { "feature": "流带宽度与交叉叠色", "preserve": "保留矩形节点与封闭贝塞尔宽带、alpha=0.42 的流带叠色及 alpha=0.92 的节点。宽带不能缩成普通连线。", "allowed_adaptation": "流量、节点数、节点间距与控制点可变;分别核对两侧流量占比和守恒,不机械等宽。", "evidence": [ { "line": 62, "end_line": 63, "code": " rect = Rectangle((left_x - node_width / 2, y0), node_width, y1 - y0,\n facecolor=source_colors[i], edgecolor='none', alpha=0.92, zorder=3)", "href": "sources/advanced.sankey/original.html#L62" }, { "line": 72, "end_line": 73, "code": " rect = Rectangle((right_x - node_width / 2, y0), node_width, y1 - y0,\n facecolor=target_colors[i], edgecolor='none', alpha=0.92, zorder=3)", "href": "sources/advanced.sankey/original.html#L72" }, { "line": 105, "end_line": 106, "code": " patch = PathPatch(Path(verts, codes),\n facecolor=flow_color, edgecolor='none', alpha=0.42, zorder=2)", "href": "sources/advanced.sankey/original.html#L105" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.waterfall", "display_name": "累计增益阶梯与贡献色带", "tags": [ "变化", "组成", "比较" ], "purpose": "每个模块给累计表现增加或减少多少?", "data_requirements": [ "起始值", "按步骤排列的增量" ], "composition": "阶梯线和圆点;各步贡献带向右延展", "visual_features": [ "透明层带叠加", "顶部数值", "总增益框" ], "adaptation_notes": "实际不是浮动柱瀑布图;固定透明度贡献带而非连续渐变;增量顺序决定展示路径。", "number": 18, "kind": "recipe", "legacy_title": "Waterfall Chart — 瀑布图(彩色渐变柱图 + 连接线 + 顶部数值标注)", "legacy_ref": "advanced #6", "source": { "original_code": "sources/advanced.waterfall/original.py", "execution_code": "sources/advanced.waterfall/render.py", "recipe_section": "sources/advanced.waterfall/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "ccd19e501c44966dc9df6d822f38bfb035db3de45342728be0dab166bf90f691", "code_sha256": "0dddc0405c5938fed50a92c8ee6eab7ffaa46930b5d93a118dda1d565fa16b77", "execution_sha256": "e66718d60df1e5dbab66aa6a39631d952010e8721229b9a67c845b37f4608bef", "code_view": "sources/advanced.waterfall/original.html" }, "title_mismatch": false, "compatibility_patches": [ "移除重复 handlelength 参数,保留首次声明的 1.6" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.waterfall-1.png", "thumbnail": "thumbnails/advanced.waterfall-1.jpg", "sha256": "f30ecc0d8f118ec3a459b1dfe6b30a9ba39f74b68fdd65fb6c095a5632f63a25", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 30, "operation": "fill_between", "code": " ax.fill_between([x_positions[i] - 0.5, x_positions[-1] + 0.5], bottom, top, alpha=0.15, color=c, zorder=1 + i)" }, { "line": 32, "operation": "plot", "code": " ax.plot([x_positions[i] - 0.5, x_positions[-1] + 0.5], [cum[i], cum[i]], color=c, linewidth=0.7, linestyle='--', alpha=0.35, zorder=1 + i)" }, { "line": 36, "operation": "fill_between", "code": "ax.fill_between([x_positions[0] - 0.5, x_positions[-1] + 0.5], 0, cum[0], alpha=0.06, color=PALETTE[0], zorder=0)" }, { "line": 40, "operation": "step", "code": "ax.step(x_positions, cum, where='mid', color=PALETTE[0], linewidth=2.8, zorder=10)" }, { "line": 45, "operation": "scatter", "code": " ax.scatter(x_positions[i], cum[i], color=c, s=90, zorder=11, edgecolors='white', linewidths=2.0)" } ], "literal_colormaps": [], "aliases": [ "增益分解", "消融贡献", "阶梯面积" ], "related_ids": [ "competition.waterfall", "academic.ablation", "advanced.diverging_bar" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.waterfall.md", "fidelity_checkpoints": [ { "feature": "阶梯线下的延展贡献带", "preserve": "保留累计阶梯、白边圆点、各步贡献带向右延展的透明叠加;这个配方的设计不是浮动柱瀑布图。", "allowed_adaptation": "步数、正负贡献和范围按当前数据重算;标签位置可调,不能平滑掉离散阶梯。", "evidence": [ { "line": 30, "end_line": 31, "code": " ax.fill_between([x_positions[i] - 0.5, x_positions[-1] + 0.5], bottom, top,\n alpha=0.15, color=c, zorder=1 + i)", "href": "sources/advanced.waterfall/original.html#L30" }, { "line": 36, "end_line": 37, "code": "ax.fill_between([x_positions[0] - 0.5, x_positions[-1] + 0.5], 0, cum[0],\n alpha=0.06, color=PALETTE[0], zorder=0)", "href": "sources/advanced.waterfall/original.html#L36" }, { "line": 40, "end_line": 40, "code": "ax.step(x_positions, cum, where='mid', color=PALETTE[0], linewidth=2.8, zorder=10)", "href": "sources/advanced.waterfall/original.html#L40" }, { "line": 45, "end_line": 46, "code": " ax.scatter(x_positions[i], cum[i], color=c, s=90, zorder=11,\n edgecolors='white', linewidths=2.0)", "href": "sources/advanced.waterfall/original.html#L45" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.shap_summary", "display_name": "SHAP散点蜂群与平均贡献条", "tags": [ "解释", "分布", "排序", "组合" ], "purpose": "特征怎样影响预测,哪个特征整体贡献更大?", "data_requirements": [ "样本×特征SHAP值", "对应特征值" ], "composition": "左侧抖动SHAP散点;右侧平均绝对贡献条", "visual_features": [ "特征值红蓝映射", "共享特征行", "条形高亮" ], "adaptation_notes": "示例SHAP值是随机模拟,未计算模型解释;颜色与贡献正负是不同含义;需提供真实解释结果。", "number": 19, "kind": "recipe", "legacy_title": "SHAP Summary Plot — SHAP 特征重要性图", "legacy_ref": "advanced #7", "source": { "original_code": "sources/advanced.shap_summary/original.py", "execution_code": "sources/advanced.shap_summary/render.py", "recipe_section": "sources/advanced.shap_summary/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "4667bbbbc739b808beefd08b440c49872d5aa3db7db66a4c0e2c073b6a5bf197", "code_sha256": "bc51db00207052097fc1a5e9466c40f1a94867e99212e1fe97dea20f97586a9b", "execution_sha256": "bc51db00207052097fc1a5e9466c40f1a94867e99212e1fe97dea20f97586a9b", "code_view": "sources/advanced.shap_summary/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.shap_summary-1.png", "thumbnail": "thumbnails/advanced.shap_summary-1.jpg", "sha256": "48d286cfe70a9b001e3f65ccb5e8c8cef23757a9811edc979ec38d2960fae6c0", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 24, "operation": "scatter", "code": " sc = ax_shap.scatter(shap_vals, y_jitter, c=feat_vals, cmap='coolwarm', s=10, alpha=0.65, vmin=0, vmax=1, edgecolors='none')" }, { "line": 45, "operation": "barh", "code": " ax_bar.barh(i, v, color=_lighten(c, 0.4), edgecolor=c, linewidth=1.5, height=0.5, alpha=0.9)" } ], "literal_colormaps": [ "coolwarm" ], "aliases": [ "SHAP", "beeswarm", "特征贡献方向" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.shap_summary.md", "fidelity_checkpoints": [ { "feature": "共享特征行的散点与汇总条", "preserve": "保留左侧透明抖动散点、特征值连续着色与右侧浅填充深描边的平均绝对贡献条,两侧同一特征顺序。", "allowed_adaptation": "真实 SHAP、特征值、特征数量和排序可变;色条仍表示特征值,不混成类别颜色。", "evidence": [ { "line": 24, "end_line": 25, "code": " sc = ax_shap.scatter(shap_vals, y_jitter, c=feat_vals, cmap='coolwarm',\n s=10, alpha=0.65, vmin=0, vmax=1, edgecolors='none')", "href": "sources/advanced.shap_summary/original.html#L24" }, { "line": 36, "end_line": 36, "code": "cbar = plt.colorbar(sc, ax=ax_shap, shrink=0.5, pad=0.02, aspect=20)", "href": "sources/advanced.shap_summary/original.html#L36" }, { "line": 45, "end_line": 46, "code": " ax_bar.barh(i, v, color=_lighten(c, 0.4), edgecolor=c,\n linewidth=1.5, height=0.5, alpha=0.9)", "href": "sources/advanced.shap_summary/original.html#L45" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.bland_altman", "display_name": "Bland–Altman一致性图", "tags": [ "关联", "误差" ], "purpose": "两种测量方法是否一致,偏差是否随量级变化?", "data_requirements": [ "同一样本的两种测量值" ], "composition": "均值横轴、差值纵轴;偏差与一致性界限", "visual_features": [ "嵌套透明水平带", "比例偏差线", "异常点标签" ], "adaptation_notes": "带状区域主要按差值标准差绘制,不应笼统称为参数估计CI;一致性不等于高相关。", "number": 20, "kind": "recipe", "legacy_title": "Bland-Altman Plot — Bland-Altman 一致性图(分层 CI 带 + 比例偏差线 + 异常值标签)", "legacy_ref": "advanced #8", "source": { "original_code": "sources/advanced.bland_altman/original.py", "execution_code": "sources/advanced.bland_altman/render.py", "recipe_section": "sources/advanced.bland_altman/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "77b8bb1cf8729236d62ba1cb85a87813185b2cc2f280419ae0409b4b6c999e48", "code_sha256": "212d9fa8cc00e96d278a384c241caf5aaf25c8ad399ee200b546da7386555a4a", "execution_sha256": "212d9fa8cc00e96d278a384c241caf5aaf25c8ad399ee200b546da7386555a4a", "code_view": "sources/advanced.bland_altman/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.bland_altman-1.png", "thumbnail": "thumbnails/advanced.bland_altman-1.jpg", "sha256": "e6812734b00659ca2589c600fb0c42af7804d5f50085f8553fe69920e04ee193", "pixels": [ 1260, 990 ], "native_inches": [ 7.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "fill_between", "code": "ax.fill_between(x_range, mean_diff - 0.5 * std_diff, mean_diff + 0.5 * std_diff, alpha=0.15, color=PALETTE[0], label='±0.5 SD')" }, { "line": 29, "operation": "fill_between", "code": "ax.fill_between(x_range, mean_diff - 1.0 * std_diff, mean_diff + 1.0 * std_diff, alpha=0.10, color=PALETTE[0])" }, { "line": 32, "operation": "fill_between", "code": "ax.fill_between(x_range, lower, upper, alpha=0.06, color=PALETTE[3], label='±1.96 SD (95% CI)')" }, { "line": 35, "operation": "scatter", "code": "ax.scatter(mean_vals, diff_vals, color=PALETTE[0], alpha=0.55, s=30, edgecolors='white', linewidths=0.5, zorder=3)" }, { "line": 51, "operation": "plot", "code": "ax.plot(x_fit, p(x_fit), color=COLORS['highlight'], linewidth=1.5, linestyle='-.', label=f'Prop. bias (slope={z[0]:.3f})', zorder=4)" } ], "literal_colormaps": [], "aliases": [ "Bland Altman", "方法一致性" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.bland_altman.md", "fidelity_checkpoints": [ { "feature": "一致性界限与嵌套浅带", "preserve": "保留均值差、界限线、三档浅色水平区和透明白边散点,不简化成一条回归线。", "allowed_adaptation": "差值方向、SD 与一致性限按配对数据计算;一致性限不是均值置信区间,标签应准确。", "evidence": [ { "line": 26, "end_line": 27, "code": "ax.fill_between(x_range, mean_diff - 0.5 * std_diff, mean_diff + 0.5 * std_diff,\n alpha=0.15, color=PALETTE[0], label='±0.5 SD')", "href": "sources/advanced.bland_altman/original.html#L26" }, { "line": 29, "end_line": 30, "code": "ax.fill_between(x_range, mean_diff - 1.0 * std_diff, mean_diff + 1.0 * std_diff,\n alpha=0.10, color=PALETTE[0])", "href": "sources/advanced.bland_altman/original.html#L29" }, { "line": 32, "end_line": 32, "code": "ax.fill_between(x_range, lower, upper, alpha=0.06, color=PALETTE[3], label='±1.96 SD (95% CI)')", "href": "sources/advanced.bland_altman/original.html#L32" }, { "line": 35, "end_line": 36, "code": "ax.scatter(mean_vals, diff_vals, color=PALETTE[0], alpha=0.55, s=30,\n edgecolors='white', linewidths=0.5, zorder=3)", "href": "sources/advanced.bland_altman/original.html#L35" }, { "line": 39, "end_line": 40, "code": "ax.axhline(mean_diff, color=PALETTE[0], linestyle='-', linewidth=1.8,\n label=f'Mean bias: {mean_diff:.2f}')", "href": "sources/advanced.bland_altman/original.html#L39" }, { "line": 42, "end_line": 43, "code": "ax.axhline(upper, color=PALETTE[3], linestyle='--', linewidth=1.2,\n label=f'+1.96 SD: {upper:.2f}')", "href": "sources/advanced.bland_altman/original.html#L42" }, { "line": 44, "end_line": 45, "code": "ax.axhline(lower, color=PALETTE[3], linestyle='--', linewidth=1.2,\n label=f'-1.96 SD: {lower:.2f}')", "href": "sources/advanced.bland_altman/original.html#L44" }, { "line": 51, "end_line": 52, "code": "ax.plot(x_fit, p(x_fit), color=COLORS['highlight'], linewidth=1.5, linestyle='-.',\n label=f'Prop. bias (slope={z[0]:.3f})', zorder=4)", "href": "sources/advanced.bland_altman/original.html#L51" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.kaplan_meier", "display_name": "生存阶梯与风险人数表", "tags": [ "生存", "趋势", "组合" ], "purpose": "分组生存概率和在险人数如何随时间变化?", "data_requirements": [ "实际应用需生存时间、事件/删失状态与分组" ], "composition": "上方阶梯曲线及区间;下方风险表", "visual_features": [ "阶梯细线", "透明区间", "中位生存期引线" ], "adaptation_notes": "示例为无删失时间的演示曲线,CI及log-rank标注含示意成分;不能替代正式生存估计。", "number": 21, "kind": "recipe", "legacy_title": "Kaplan-Meier Survival Curve — 生存曲线(CI 带 + 中位数标记 + 风险人数表 + Log-Rank p)", "legacy_ref": "advanced #9", "source": { "original_code": "sources/advanced.kaplan_meier/original.py", "execution_code": "sources/advanced.kaplan_meier/render.py", "recipe_section": "sources/advanced.kaplan_meier/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "8bd10c1924ee0b643c2151e913368f6f0a32eebb2fda2e794c4371d53f3e08f2", "code_sha256": "a5849a1a1d17d515c65ad50f43132f4b826396897dca1c784e324bc46f9df108", "execution_sha256": "a5849a1a1d17d515c65ad50f43132f4b826396897dca1c784e324bc46f9df108", "code_view": "sources/advanced.kaplan_meier/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.kaplan_meier-1.png", "thumbnail": "thumbnails/advanced.kaplan_meier-1.jpg", "sha256": "33bc84f57d811366d421cd5b0d74f518f4c053b86f256a9896126a8071c86a15", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 34, "operation": "step", "code": "ax.step(t1, s1, where='post', color=PALETTE[0], linewidth=2.5, label='Treatment (n=50)')" }, { "line": 38, "operation": "fill_between", "code": "ax.fill_between(t1, ci_lower, ci_upper, step='post', alpha=0.12, color=PALETTE[0])" }, { "line": 42, "operation": "step", "code": "ax.step(t2, s2, where='post', color=PALETTE[3], linewidth=2.5, label='Control (n=50)')" }, { "line": 45, "operation": "fill_between", "code": "ax.fill_between(t2, ci_lower2, ci_upper2, step='post', alpha=0.12, color=PALETTE[3])" }, { "line": 58, "operation": "plot", "code": " ax.plot([med_treat, med_treat], [0, 0.5], '--', color=PALETTE[0], linewidth=1.0, alpha=0.7)" }, { "line": 59, "operation": "plot", "code": " ax.plot([0, med_treat], [0.5, 0.5], '--', color=PALETTE[0], linewidth=1.0, alpha=0.7)" }, { "line": 60, "operation": "scatter", "code": " ax.scatter([med_treat], [0.5], color=PALETTE[0], s=60, zorder=5, marker='D', edgecolors='white', linewidths=1.0)" }, { "line": 68, "operation": "plot", "code": " ax.plot([med_ctrl, med_ctrl], [0, 0.5], '--', color=PALETTE[3], linewidth=1.0, alpha=0.7)" }, { "line": 69, "operation": "plot", "code": " ax.plot([0, med_ctrl], [0.5, 0.5], '--', color=PALETTE[3], linewidth=1.0, alpha=0.7)" }, { "line": 70, "operation": "scatter", "code": " ax.scatter([med_ctrl], [0.5], color=PALETTE[3], s=60, zorder=5, marker='D', edgecolors='white', linewidths=1.0)" } ], "literal_colormaps": [], "aliases": [ "Kaplan Meier", "KM", "生存分析" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.kaplan_meier.md", "fidelity_checkpoints": [ { "feature": "阶梯、透明区间与风险表", "preserve": "保留阶梯曲线与 step=post 的区间形状、下方风险表及可用的中位生存期引线,不平滑成连续曲线。", "allowed_adaptation": "按实际时间、事件和删失计算生存率、区间及风险人数;未达到中位生存期时不造交点。", "evidence": [ { "line": 34, "end_line": 34, "code": "ax.step(t1, s1, where='post', color=PALETTE[0], linewidth=2.5, label='Treatment (n=50)')", "href": "sources/advanced.kaplan_meier/original.html#L34" }, { "line": 38, "end_line": 38, "code": "ax.fill_between(t1, ci_lower, ci_upper, step='post', alpha=0.12, color=PALETTE[0])", "href": "sources/advanced.kaplan_meier/original.html#L38" }, { "line": 42, "end_line": 42, "code": "ax.step(t2, s2, where='post', color=PALETTE[3], linewidth=2.5, label='Control (n=50)')", "href": "sources/advanced.kaplan_meier/original.html#L42" }, { "line": 45, "end_line": 45, "code": "ax.fill_between(t2, ci_lower2, ci_upper2, step='post', alpha=0.12, color=PALETTE[3])", "href": "sources/advanced.kaplan_meier/original.html#L45" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.volcano", "display_name": "差异倍数与显著性火山图", "tags": [ "筛选", "关联" ], "purpose": "哪些特征变化幅度大且统计显著?", "data_requirements": [ "特征名", "log2倍数变化", "p值或校正p值" ], "composition": "单面板散点;横纵阈值线", "visual_features": [ "中央阈值阴影", "背景密度", "重点特征引线" ], "adaptation_notes": "红蓝或上下调标签需对照实际语义;示例显著性是模拟,不能用于实证结论。", "number": 22, "kind": "recipe", "legacy_title": "Volcano Plot — 火山图(基因差异表达:渐变密度背景 + 基因标签 + 倍数变化阴影)", "legacy_ref": "advanced #10", "source": { "original_code": "sources/advanced.volcano/original.py", "execution_code": "sources/advanced.volcano/render.py", "recipe_section": "sources/advanced.volcano/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "1238fffb336964eadd2009fdc2270bd8229ab57aad47a2f8e7fc148eeb775e05", "code_sha256": "9b80ad99a5683d5e5004839bd67fb132305ce0d17784881fd2d702a9e2055d2b", "execution_sha256": "9b80ad99a5683d5e5004839bd67fb132305ce0d17784881fd2d702a9e2055d2b", "code_view": "sources/advanced.volcano/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.volcano-1.png", "thumbnail": "thumbnails/advanced.volcano-1.jpg", "sha256": "777c8ba25b37a0dddf159285aea8978795a5ebb6fa008da6a9cd47f7a561163a", "pixels": [ 1260, 990 ], "native_inches": [ 7.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "hexbin", "code": "hb = ax.hexbin(log2fc, neg_log_p, gridsize=30, cmap='Blues', alpha=0.25, mincnt=1, linewidths=0.0, zorder=0)" }, { "line": 34, "operation": "scatter", "code": "ax.scatter(log2fc[ns], neg_log_p[ns], c=COLORS['neutral'], alpha=0.35, s=8, label=f'NS ({ns.sum()})', zorder=2)" }, { "line": 36, "operation": "scatter", "code": "ax.scatter(log2fc[sig_up], neg_log_p[sig_up], c=PALETTE[3], alpha=0.7, s=15, label=f'Up ({sig_up.sum()})', edgecolors='white', linewidths=0.3, zorder=3)" }, { "line": 38, "operation": "scatter", "code": "ax.scatter(log2fc[sig_down], neg_log_p[sig_down], c=PALETTE[0], alpha=0.7, s=15, label=f'Down ({sig_down.sum()})', edgecolors='white', linewidths=0.3, zorder=3)" } ], "literal_colormaps": [ "Blues" ], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.volcano.md", "fidelity_checkpoints": [ { "feature": "阈值区与重点点云", "preserve": "保留灰色背景点、两侧重点点的透明度差异、阈值参考与重点引线,不能让背景点遮没显著点。", "allowed_adaptation": "倍数变化、检验结果、阈值和标签数量据实调整,显著性不能由视觉挑选。", "evidence": [ { "line": 25, "end_line": 25, "code": "ax.axvspan(-1, 1, alpha=0.06, color=COLORS['ref_line'], zorder=0, label='|FC| < 2')", "href": "sources/advanced.volcano/original.html#L25" }, { "line": 26, "end_line": 26, "code": "ax.axvspan(1, log2fc.max() + 1, alpha=0.04, color=PALETTE[3], zorder=0)", "href": "sources/advanced.volcano/original.html#L26" }, { "line": 27, "end_line": 27, "code": "ax.axvspan(log2fc.min() - 1, -1, alpha=0.04, color=PALETTE[0], zorder=0)", "href": "sources/advanced.volcano/original.html#L27" }, { "line": 34, "end_line": 35, "code": "ax.scatter(log2fc[ns], neg_log_p[ns], c=COLORS['neutral'], alpha=0.35, s=8,\n label=f'NS ({ns.sum()})', zorder=2)", "href": "sources/advanced.volcano/original.html#L34" }, { "line": 36, "end_line": 37, "code": "ax.scatter(log2fc[sig_up], neg_log_p[sig_up], c=PALETTE[3], alpha=0.7, s=15,\n label=f'Up ({sig_up.sum()})', edgecolors='white', linewidths=0.3, zorder=3)", "href": "sources/advanced.volcano/original.html#L36" }, { "line": 38, "end_line": 39, "code": "ax.scatter(log2fc[sig_down], neg_log_p[sig_down], c=PALETTE[0], alpha=0.7, s=15,\n label=f'Down ({sig_down.sum()})', edgecolors='white', linewidths=0.3, zorder=3)", "href": "sources/advanced.volcano/original.html#L38" }, { "line": 42, "end_line": 42, "code": "ax.axhline(2, color=COLORS['ref_line'], linestyle='--', linewidth=0.8, alpha=0.7)", "href": "sources/advanced.volcano/original.html#L42" }, { "line": 43, "end_line": 43, "code": "ax.axvline(1, color=COLORS['ref_line'], linestyle='--', linewidth=0.8, alpha=0.7)", "href": "sources/advanced.volcano/original.html#L43" }, { "line": 44, "end_line": 44, "code": "ax.axvline(-1, color=COLORS['ref_line'], linestyle='--', linewidth=0.8, alpha=0.7)", "href": "sources/advanced.volcano/original.html#L44" }, { "line": 51, "end_line": 59, "code": " ax.annotate(gene_names[idx],\n xy=(log2fc[idx], neg_log_p[idx]),\n xytext=(log2fc[idx] + 0.3 * np.sign(log2fc[idx]),\n neg_log_p[idx] + 0.5),\n fontsize=7, fontstyle='italic',\n color=COLORS['text'],\n arrowprops=dict(arrowstyle='->', color=COLORS['text'], lw=0.7),\n bbox=dict(boxstyle='round,pad=0.15', facecolor='white',\n edgecolor=COLORS['neutral'], alpha=0.85))", "href": "sources/advanced.volcano/original.html#L51" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.calibration", "display_name": "概率校准与预测概率分布", "tags": [ "预测", "诊断", "组合" ], "purpose": "预测概率是否可靠,样本集中在哪些概率段?", "data_requirements": [ "预测概率与真实二分类结果", "分箱统计及区间" ], "composition": "上方可靠性曲线;下方概率直方图;共享横轴", "visual_features": [ "理想对角线", "各曲线单层透明区间", "Brier摘要" ], "adaptation_notes": "示例校准点、区间与Brier为演示输入;正式图需从同一批预测与标签计算,稀疏箱不宜强行平滑。", "number": 23, "kind": "recipe", "legacy_title": "Calibration Plot — 校准曲线(渐变 CI 带 + 底部直方图 + Brier Score 标注)", "legacy_ref": "advanced #11", "source": { "original_code": "sources/advanced.calibration/original.py", "execution_code": "sources/advanced.calibration/render.py", "recipe_section": "sources/advanced.calibration/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "6d6ff1b17b125e223498378ba1caf849340aaa7aab7c1a690d84e94de9e9b454", "code_sha256": "fac27d456dd3383ca62f43237464ae159f7a2f09a7593d4402ebca4225872fa4", "execution_sha256": "fac27d456dd3383ca62f43237464ae159f7a2f09a7593d4402ebca4225872fa4", "code_view": "sources/advanced.calibration/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.calibration-1.png", "thumbnail": "thumbnails/advanced.calibration-1.jpg", "sha256": "8424ad80a147e6cae818a3410726682c40bb3f02a4c4b7a1fe903b9d2016b071", "pixels": [ 1080, 1260 ], "native_inches": [ 6.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 30, "operation": "plot", "code": "ax_cal.plot([0, 1], [0, 1], 'k--', linewidth=0.8, alpha=0.5, label='Perfect')" }, { "line": 34, "operation": "fill_between", "code": "ax_cal.fill_between(bin_centers, model_a - ci_width_a, model_a + ci_width_a, alpha=0.15, color=PALETTE[0])" }, { "line": 36, "operation": "plot", "code": "ax_cal.plot(bin_centers, model_a, 'o-', color=PALETTE[0], linewidth=2.2, markersize=7, label=f'Ours (Brier={brier_a:.3f})', markeredgecolor='white', markeredgewidth=1.0)" }, { "line": 42, "operation": "fill_between", "code": "ax_cal.fill_between(bin_centers, model_b - ci_width_b, model_b + ci_width_b, alpha=0.12, color=PALETTE[3])" }, { "line": 44, "operation": "plot", "code": "ax_cal.plot(bin_centers, model_b, 's--', color=PALETTE[3], linewidth=2.0, markersize=7, label=f'Baseline (Brier={brier_b:.3f})', markeredgecolor='white', markeredgewidth=1.0)" }, { "line": 66, "operation": "hist", "code": "ax_hist.hist(pred_probs_a, bins=20, alpha=0.5, color=PALETTE[0], label='Ours', edgecolor='white', linewidth=0.5)" }, { "line": 68, "operation": "hist", "code": "ax_hist.hist(pred_probs_b, bins=20, alpha=0.4, color=PALETTE[3], label='Baseline', edgecolor='white', linewidth=0.5)" } ], "literal_colormaps": [], "aliases": [ "reliability diagram", "校准图", "Brier" ], "related_ids": [ "advanced.fan", "empirical.prediction_ci", "competition.prediction_actual" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.calibration.md", "fidelity_checkpoints": [ { "feature": "可靠性曲线加概率直方", "preserve": "保留上方校准曲线的各自单层透明区间、不同点形/线型、理想线与下方概率直方。代码不是每条线多层渐变。", "allowed_adaptation": "区间、分箱和 Brier 从实际概率与标签计算;两部分共享概率范围,面板尺寸可调且检查绘图区对齐。", "evidence": [ { "line": 30, "end_line": 30, "code": "ax_cal.plot([0, 1], [0, 1], 'k--', linewidth=0.8, alpha=0.5, label='Perfect')", "href": "sources/advanced.calibration/original.html#L30" }, { "line": 34, "end_line": 35, "code": "ax_cal.fill_between(bin_centers, model_a - ci_width_a, model_a + ci_width_a,\n alpha=0.15, color=PALETTE[0])", "href": "sources/advanced.calibration/original.html#L34" }, { "line": 36, "end_line": 38, "code": "ax_cal.plot(bin_centers, model_a, 'o-', color=PALETTE[0], linewidth=2.2,\n markersize=7, label=f'Ours (Brier={brier_a:.3f})',\n markeredgecolor='white', markeredgewidth=1.0)", "href": "sources/advanced.calibration/original.html#L36" }, { "line": 42, "end_line": 43, "code": "ax_cal.fill_between(bin_centers, model_b - ci_width_b, model_b + ci_width_b,\n alpha=0.12, color=PALETTE[3])", "href": "sources/advanced.calibration/original.html#L42" }, { "line": 44, "end_line": 46, "code": "ax_cal.plot(bin_centers, model_b, 's--', color=PALETTE[3], linewidth=2.0,\n markersize=7, label=f'Baseline (Brier={brier_b:.3f})',\n markeredgecolor='white', markeredgewidth=1.0)", "href": "sources/advanced.calibration/original.html#L44" }, { "line": 66, "end_line": 67, "code": "ax_hist.hist(pred_probs_a, bins=20, alpha=0.5, color=PALETTE[0], label='Ours',\n edgecolor='white', linewidth=0.5)", "href": "sources/advanced.calibration/original.html#L66" }, { "line": 68, "end_line": 69, "code": "ax_hist.hist(pred_probs_b, bins=20, alpha=0.4, color=PALETTE[3], label='Baseline',\n edgecolor='white', linewidth=0.5)", "href": "sources/advanced.calibration/original.html#L68" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.funnel", "display_name": "Meta分析漏斗图", "tags": [ "误差", "诊断" ], "purpose": "研究效应与精度关系是否呈不对称分布?", "data_requirements": [ "每项研究的效应量和标准误", "汇总效应" ], "composition": "效应量横轴;倒置标准误纵轴", "visual_features": [ "90/95/99%嵌套漏斗区", "汇总竖线", "异常研究标签" ], "adaptation_notes": "嵌套区是参考界限;Egger及汇总统计需用真实研究估计,不能只凭形状断言偏倚。", "number": 24, "kind": "recipe", "legacy_title": "Funnel Plot — 漏斗图(Meta 分析:渐变 CI 带 90/95/99% + 研究标签 + Egger 检验)", "legacy_ref": "advanced #12", "source": { "original_code": "sources/advanced.funnel/original.py", "execution_code": "sources/advanced.funnel/render.py", "recipe_section": "sources/advanced.funnel/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "5d6ba62cc97bb46f0c2619c43ab25153e0b73c9b7d40807523cb4b6d214cda04", "code_sha256": "1f1d1643a61239d32f6912ff50549e03ad0c77d62e369a60475a53f0e5f593cd", "execution_sha256": "1f1d1643a61239d32f6912ff50549e03ad0c77d62e369a60475a53f0e5f593cd", "code_view": "sources/advanced.funnel/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.funnel-1.png", "thumbnail": "thumbnails/advanced.funnel-1.jpg", "sha256": "1ccc1f257da6a0232107c796cc471289cca17d44739060c66ccba98766bb8da4", "pixels": [ 1260, 990 ], "native_inches": [ 7.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 29, "operation": "fill_betweenx", "code": " ax.fill_betweenx(se_range, mean_eff - z_val * se_range, mean_eff + z_val * se_range, alpha=alpha, color=color, label=label)" }, { "line": 38, "operation": "scatter", "code": "ax.scatter(effects, se, color=PALETTE[0], s=50, alpha=0.8, edgecolors='white', linewidths=0.8, zorder=4)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.funnel.md", "fidelity_checkpoints": [ { "feature": "三档漏斗区而非单片三角", "preserve": "保留 99/95/90% 的三档嵌套区与透明度对应关系、汇总竖线和倒置标准误轴;这里的层序不照搬折线图。", "allowed_adaptation": "由效应与标准误计算边界和汇总量;色相可变,异常标注与检验结果须重算。", "evidence": [ { "line": 29, "end_line": 32, "code": " ax.fill_betweenx(se_range,\n mean_eff - z_val * se_range,\n mean_eff + z_val * se_range,\n alpha=alpha, color=color, label=label)", "href": "sources/advanced.funnel/original.html#L29" }, { "line": 35, "end_line": 35, "code": "ax.axvline(mean_eff, color=PALETTE[0], linestyle='-', linewidth=1.8, alpha=0.6)", "href": "sources/advanced.funnel/original.html#L35" }, { "line": 38, "end_line": 39, "code": "ax.scatter(effects, se, color=PALETTE[0], s=50, alpha=0.8, edgecolors='white',\n linewidths=0.8, zorder=4)", "href": "sources/advanced.funnel/original.html#L38" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.dot_ci", "display_name": "多指标点区间与汇总菱形", "tags": [ "比较", "误差", "组合" ], "purpose": "每个方法的多个指标及区间如何比较?", "data_requirements": [ "方法×指标得分", "各项CI", "可选p值与汇总量" ], "composition": "每方法一行;多个错位点区间;汇总菱形", "visual_features": [ "点色随模拟显著性", "菱形摘要", "轻量网格" ], "adaptation_notes": "不同单位先统一可比尺度;示例汇总为演示,不能自动解释为Meta分析合并效应。", "number": 25, "kind": "recipe", "legacy_title": "Dot Plot with CI — 点图+置信区间(按显著性渐变着色 + 汇总菱形)", "legacy_ref": "advanced #13", "source": { "original_code": "sources/advanced.dot_ci/original.py", "execution_code": "sources/advanced.dot_ci/render.py", "recipe_section": "sources/advanced.dot_ci/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "c35da3f410a20313817179674a8cf40adee7183649c7943290b1f8ecf342cf1e", "code_sha256": "f6f55ff76e90afeb348f9437bce8557463ffce0c00d40ca7c96d4143a11b4ad5", "execution_sha256": "f6f55ff76e90afeb348f9437bce8557463ffce0c00d40ca7c96d4143a11b4ad5", "code_view": "sources/advanced.dot_ci/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.dot_ci-1.png", "thumbnail": "thumbnails/advanced.dot_ci-1.jpg", "sha256": "74981b7b97ee5bcc9bbb3081f26049d4bffb88d31973694388c75be69abbc93d", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 38, "operation": "errorbar", "code": "ax.errorbar(scores[i, j], y_base[i] + offsets[j], xerr=ci[i, j]," }, { "line": 49, "operation": "fill", "code": "ax.fill(diamond_x, diamond_y, color=PALETTE[0] if i == 0 else COLORS['ref_line']," } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "empirical.forest", "empirical.subgroup_forest" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.dot_ci.md", "fidelity_checkpoints": [ { "feature": "错位点区间和汇总菱形", "preserve": "保留方法行内错位的点区间、白边点与单独汇总菱形;不能只留中心点丢区间。", "allowed_adaptation": "区间、颜色映射与汇总须有真实计算依据;示例 p 值和简单平均不能直接用作正式统计,图例与点色需一致。", "evidence": [ { "line": 38, "end_line": 41, "code": " ax.errorbar(scores[i, j], y_base[i] + offsets[j], xerr=ci[i, j],\n fmt='o', color=dot_color, markersize=8, capsize=3,\n linewidth=1.5, markeredgecolor='white', markeredgewidth=0.8,\n label=metric if i == 0 else '', zorder=3)", "href": "sources/advanced.dot_ci/original.html#L38" }, { "line": 49, "end_line": 50, "code": " ax.fill(diamond_x, diamond_y, color=PALETTE[0] if i == 0 else COLORS['ref_line'],\n alpha=0.7, zorder=4)", "href": "sources/advanced.dot_ci/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.cluster_heatmap", "display_name": "列聚类树与数值热力矩阵", "tags": [ "矩阵", "聚类" ], "purpose": "数值矩阵有哪些相似列和块结构?", "data_requirements": [ "样本×特征矩阵", "行列标签" ], "composition": "顶部列树状图;下方矩形热图;侧色条", "visual_features": [ "红蓝色阶", "白格线", "聚类边界" ], "adaptation_notes": "当前预览是首个主要示例;原章节另有双侧聚类变体尚无此图库预览;轮廓系数标注需核实真实计算。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 26, "kind": "recipe", "legacy_title": "Cluster Heatmap — 聚类热力图(带树状图 + 聚类边界 + 轮廓系数标注)", "legacy_ref": "advanced #14", "source": { "original_code": "sources/advanced.cluster_heatmap/original.py", "execution_code": "sources/advanced.cluster_heatmap/render.py", "recipe_section": "sources/advanced.cluster_heatmap/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "cedf679717abe4595e60ff8bf4fa57ace9d7aaf628131c9b77501fda4cda3476", "code_sha256": "afaf99e2d36a5fb6190bc2dad26cbd9fbed7ee1693f732011e7be9b54d04f17b", "execution_sha256": "afaf99e2d36a5fb6190bc2dad26cbd9fbed7ee1693f732011e7be9b54d04f17b", "code_view": "sources/advanced.cluster_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.cluster_heatmap-1.png", "thumbnail": "thumbnails/advanced.cluster_heatmap-1.jpg", "sha256": "9827857e30220e9dc961672f260c15d2d6ff69919be6b97223ca9b97098f825e", "pixels": [ 1609, 1692 ], "native_inches": [ 10.0, 8.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 30, "operation": "dendrogram", "code": "dn_col = dendrogram(Z_col, ax=ax_dendro_top, leaf_font_size=0," }, { "line": 41, "operation": "imshow", "code": "im = ax_heat.imshow(ordered_data, aspect='auto', cmap=palette_cmap('diverging'), interpolation='nearest')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.cluster_heatmap.md", "fidelity_checkpoints": [ { "feature": "树状图与重排矩阵", "preserve": "保留主要示例的顶部树状图、按聚类重排的热图、格线与色条,树叶顺序与矩阵列一致。", "allowed_adaptation": "矩阵规模、聚类方法和色阶按数据选择;原章节另一个变体不受这个预览结构限制。", "evidence": [ { "line": 30, "end_line": 32, "code": "dn_col = dendrogram(Z_col, ax=ax_dendro_top, leaf_font_size=0,\n color_threshold=Z_col[-n_clusters + 1, 2],\n above_threshold_color=COLORS['ref_line'])", "href": "sources/advanced.cluster_heatmap/original.html#L30" }, { "line": 41, "end_line": 41, "code": "im = ax_heat.imshow(ordered_data, aspect='auto', cmap=palette_cmap('diverging'), interpolation='nearest')", "href": "sources/advanced.cluster_heatmap/original.html#L41" }, { "line": 60, "end_line": 60, "code": "cbar = plt.colorbar(im, cax=ax_cbar)", "href": "sources/advanced.cluster_heatmap/original.html#L60" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.network", "display_name": "社区网络与透明凸包", "tags": [ "网络", "聚类" ], "purpose": "网络社区、枢纽和连接强度怎样分布?", "data_requirements": [ "节点、边与权重", "可计算社区和度" ], "composition": "力导向节点连线;社区外围多边形", "visual_features": [ "透明社区凸包", "节点大小映射度", "边色和宽度映射权重" ], "adaptation_notes": "布局距离并非地理距离;单条边内部不是渐变;凸包是展示包络而非统计置信域。", "number": 27, "kind": "recipe", "legacy_title": "Network Graph — 网络图(节点大小映射度 + 社区凸包 + 边权渐变)", "legacy_ref": "advanced #15", "source": { "original_code": "sources/advanced.network/original.py", "execution_code": "sources/advanced.network/render.py", "recipe_section": "sources/advanced.network/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "8e3413982eae71c3c36d8135464ae8b95ebb9dd1f344b715d24ee85a961590f2", "code_sha256": "c36087d1e223cc6943b62a6c73b40f7eb54a0919d11aabf1eb0d50719f06342c", "execution_sha256": "79dd32e3325050ab3f942bebb5bc288f63b487a0abad9133b3a61e6071a04119", "code_view": "sources/advanced.network/original.html" }, "title_mismatch": false, "compatibility_patches": [ "保留节点 artist 以设置绘制层级", "NetworkX 不接受 zorder 参数,改为在返回对象上设置同值" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.network-1.png", "thumbnail": "thumbnails/advanced.network-1.jpg", "sha256": "71f989da67c950e50a0dcf7d72a83302fe78a7cfbcd0ef1cd32de583fd11e9be", "pixels": [ 1440, 1260 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 46, "operation": "fill", "code": "ax.fill(expanded[:, 0], expanded[:, 1]," }, { "line": 48, "operation": "plot", "code": "ax.plot(expanded[:, 0], expanded[:, 1]," }, { "line": 63, "operation": "plot", "code": "ax.plot([x0, x1], [y0, y1], color=cmap_edge(norm_w)," } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.network.md", "fidelity_checkpoints": [ { "feature": "社区浅包络与加权连边", "preserve": "保留社区透明凸包及虚线边缘、节点大小映射度、边宽和透明度映射权重,不能统一成同色同宽网络。", "allowed_adaptation": "按实际网络重算社区和布局;小社区或退化凸包可省包络并说明,接口兼容修改不改变视觉目的。", "evidence": [ { "line": 46, "end_line": 47, "code": " ax.fill(expanded[:, 0], expanded[:, 1],\n color=PALETTE[i % len(PALETTE)], alpha=0.08)", "href": "sources/advanced.network/original.html#L46" }, { "line": 48, "end_line": 50, "code": " ax.plot(expanded[:, 0], expanded[:, 1],\n color=PALETTE[i % len(PALETTE)], linewidth=1.5,\n linestyle='--', alpha=0.4)", "href": "sources/advanced.network/original.html#L48" }, { "line": 63, "end_line": 64, "code": " ax.plot([x0, x1], [y0, y1], color=cmap_edge(norm_w),\n linewidth=0.5 + 1.5 * norm_w, alpha=0.3 + 0.4 * norm_w, zorder=1)", "href": "sources/advanced.network/original.html#L63" }, { "line": 67, "end_line": 68, "code": "nx.draw_networkx_nodes(G, pos, ax=ax, node_color=node_colors, node_size=node_sizes,\n edgecolors='white', linewidths=1.2, alpha=0.9, zorder=3)", "href": "sources/advanced.network/original.html#L67" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.method_heatmap", "display_name": "多指标方法排名热力图", "tags": [ "比较", "排序", "矩阵" ], "purpose": "混合优劣方向的指标下,方法整体表现怎样?", "data_requirements": [ "方法×指标原值", "每项高优或低优方向" ], "composition": "指标列与综合列;方法行;顶部聚类树", "visual_features": [ "格内原值和名次", "列最优边框", "综合分" ], "adaptation_notes": "需要正确归一化和方向;奖牌字形可能缺失,浅黄格白字偏淡;树状图与矩阵排序应核对。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 28, "kind": "recipe", "legacy_title": "Method Comparison Heatmap — 方法对比热力图(排名标注 🥇🥈🥉 + 树状图 + 列最优高亮 + 综合排名)", "legacy_ref": "advanced #16", "source": { "original_code": "sources/advanced.method_heatmap/original.py", "execution_code": "sources/advanced.method_heatmap/render.py", "recipe_section": "sources/advanced.method_heatmap/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "03641ff2a1050da7c7af89f9d499ad1f8fe226013ec9758708e72de5ea6892ee", "code_sha256": "111179a9c2772aaa40c45be19859a2f3efdf595f872763adbeaac4cb9abcb9ed", "execution_sha256": "111179a9c2772aaa40c45be19859a2f3efdf595f872763adbeaac4cb9abcb9ed", "code_view": "sources/advanced.method_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.method_heatmap-1.png", "thumbnail": "thumbnails/advanced.method_heatmap-1.jpg", "sha256": "20fded5b83c5fe1230c22ff5491ef51e609e5c11661c73c8c32ab59798bfb602", "pixels": [ 1889, 937 ], "native_inches": [ 9.0, 4.5 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 44, "operation": "dendrogram", "code": "dn = dendrogram(Z, labels=methods, ax=ax_dendro, leaf_font_size=0," }, { "line": 55, "operation": "imshow", "code": "im = ax.imshow(ordered_norm, cmap=palette_cmap('sequential'), aspect='auto', vmin=0, vmax=1)" }, { "line": 95, "operation": "add_patch", "code": "ax.add_patch(rect)" }, { "line": 100, "operation": "add_patch", "code": "ax.add_patch(rect_border)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.latent_interpolation", "competition.radar", "advanced.parallel_coordinates", "empirical.prediction_accuracy_heatmap" ], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.method_heatmap.md", "fidelity_checkpoints": [ { "feature": "格内原值与列最优框", "preserve": "保留按列归一化着色、格内原值/名次、列最优边框和综合列,着色与显示数值分开。", "allowed_adaptation": "指标数量、优劣方向、综合权重和聚类次序按任务更新,不将不同量纲直接平均。", "evidence": [ { "line": 55, "end_line": 55, "code": "im = ax.imshow(ordered_norm, cmap=palette_cmap('sequential'), aspect='auto', vmin=0, vmax=1)", "href": "sources/advanced.method_heatmap/original.html#L55" }, { "line": 86, "end_line": 87, "code": " ax.text(j, i_display, f'{val_str}\\n{rank_label}', ha='center', va='center',\n fontsize=8.5, fontweight=weight, color=color)", "href": "sources/advanced.method_heatmap/original.html#L86" }, { "line": 91, "end_line": 94, "code": " rect = plt.Rectangle((j - 0.5, i_display - 0.5), 1, 1,\n linewidth=2.5, edgecolor=PALETTE[0],\n facecolor=_lighten(PALETTE[0], 0.5),\n alpha=0.3, zorder=4)", "href": "sources/advanced.method_heatmap/original.html#L91" }, { "line": 97, "end_line": 99, "code": " rect_border = plt.Rectangle((j - 0.5, i_display - 0.5), 1, 1,\n linewidth=2.5, edgecolor=PALETTE[0],\n facecolor='none', zorder=5)", "href": "sources/advanced.method_heatmap/original.html#L97" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.parallel_coordinates", "display_name": "多指标平行坐标", "tags": [ "比较", "多维" ], "purpose": "不同方法在哪些指标上互有优势?", "data_requirements": [ "方法×指标矩阵", "统一到可比方向与范围" ], "composition": "并排竖轴;方法折线贯穿各维度", "visual_features": [ "主方法加粗", "顶部优势区域浅阴影" ], "adaptation_notes": "高低方向必须统一;不同量纲原值不能直接共轴;阴影是优势区域而非CI。", "number": 29, "kind": "recipe", "legacy_title": "Parallel Coordinates — 平行坐标图(实线 + \"本文\"高亮 + 最优区域阴影)", "legacy_ref": "advanced #17", "source": { "original_code": "sources/advanced.parallel_coordinates/original.py", "execution_code": "sources/advanced.parallel_coordinates/render.py", "recipe_section": "sources/advanced.parallel_coordinates/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "6dc0abc4e6240192e2be75c30dbede3486db6b0462b8b23128caf3c8dab76601", "code_sha256": "d8149559247376823a3acdc805abe41b2f3b5b5d0ea93a3cdf03aa2736724c42", "execution_sha256": "d8149559247376823a3acdc805abe41b2f3b5b5d0ea93a3cdf03aa2736724c42", "code_view": "sources/advanced.parallel_coordinates/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.parallel_coordinates-1.png", "thumbnail": "thumbnails/advanced.parallel_coordinates-1.jpg", "sha256": "7d2b42647d1272c9cc12ff359f557b3d8fea00447e7fbcc08c0b905191f5f22f", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 25, "operation": "fill_between", "code": " ax.fill_between([j - 0.3, j + 0.3], 0.8, 1.0, alpha=0.06, color=COLORS['up'], zorder=0)" }, { "line": 36, "operation": "plot", "code": " ax.plot(x, row, '-', color=PALETTE[0], linewidth=3.5, zorder=5, solid_capstyle='round')" }, { "line": 39, "operation": "scatter", "code": " ax.scatter(x, row, color=PALETTE[0], s=100, zorder=6, edgecolors='white', linewidths=1.5, marker='o')" }, { "line": 50, "operation": "plot", "code": " ax.plot(x, row, '-', color=PALETTE[i], linewidth=1.5, alpha=0.6, solid_capstyle='round')" }, { "line": 52, "operation": "scatter", "code": " ax.scatter(x, row, color=PALETTE[i], s=50, zorder=4, alpha=0.7, edgecolors='white', linewidths=0.8)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.latent_interpolation", "competition.radar", "advanced.method_heatmap", "empirical.prediction_accuracy_heatmap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.parallel_coordinates.md", "fidelity_checkpoints": [ { "feature": "多维主次路径", "preserve": "保留主路径粗线和白边大点、其他路径较浅较细以及有含义的优势区浅底。", "allowed_adaptation": "维度和轴顺序可变;各维归一化与优劣方向必须一致,主方法由任务确定。", "evidence": [ { "line": 25, "end_line": 26, "code": " ax.fill_between([j - 0.3, j + 0.3], 0.8, 1.0, alpha=0.06,\n color=COLORS['up'], zorder=0)", "href": "sources/advanced.parallel_coordinates/original.html#L25" }, { "line": 36, "end_line": 37, "code": " ax.plot(x, row, '-', color=PALETTE[0], linewidth=3.5, zorder=5,\n solid_capstyle='round')", "href": "sources/advanced.parallel_coordinates/original.html#L36" }, { "line": 39, "end_line": 40, "code": " ax.scatter(x, row, color=PALETTE[0], s=100, zorder=6,\n edgecolors='white', linewidths=1.5, marker='o')", "href": "sources/advanced.parallel_coordinates/original.html#L39" }, { "line": 50, "end_line": 51, "code": " ax.plot(x, row, '-', color=PALETTE[i], linewidth=1.5, alpha=0.6,\n solid_capstyle='round')", "href": "sources/advanced.parallel_coordinates/original.html#L50" }, { "line": 52, "end_line": 53, "code": " ax.scatter(x, row, color=PALETTE[i], s=50, zorder=4, alpha=0.7,\n edgecolors='white', linewidths=0.8)", "href": "sources/advanced.parallel_coordinates/original.html#L52" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.pca_biplot", "display_name": "PCA样本得分与载荷双标图", "tags": [ "多维", "关联", "降维" ], "purpose": "样本结构与变量贡献方向怎样对应?", "data_requirements": [ "前两主成分样本得分", "载荷", "解释方差" ], "composition": "样本散点叠加载荷箭头", "visual_features": [ "浅灰样本", "原点十字", "箭头端变量名" ], "adaptation_notes": "示例得分和载荷为模拟,未运行PCA;载荷与得分缩放需一致;原点附近标签偏密。", "number": 30, "kind": "recipe", "legacy_title": "PCA Biplot — PCA 双标图(载荷箭头 + 智能标签 + 解释方差)", "legacy_ref": "advanced #18", "source": { "original_code": "sources/advanced.pca_biplot/original.py", "execution_code": "sources/advanced.pca_biplot/render.py", "recipe_section": "sources/advanced.pca_biplot/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "0012e39e39ae07ace7d7da048025fe5f6bf5ffc106150b7f453627555615d7b0", "code_sha256": "646cc05addf0cf0b5d549eaca9872cdeca1e4c4be071dc3c12dbebfc1ad97ee2", "execution_sha256": "f45e697bfdf44b9602c3cc7f69720cc00da6347750508e4062dc7b720fce186a", "code_view": "sources/advanced.pca_biplot/original.html" }, "title_mismatch": false, "compatibility_patches": [ "补充代码使用但漏导入的 COLORS" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.pca_biplot-1.png", "thumbnail": "thumbnails/advanced.pca_biplot-1.jpg", "sha256": "5a2d1ad9354a7d7a8151d3b786c1fa41727232117c48f31ca7a7ae5c787c6c57", "pixels": [ 1440, 1260 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "scatter", "code": "ax.scatter(scores[:, 0], scores[:, 1], s=25, alpha=0.35, color=COLORS['gray'], edgecolors='white', linewidths=0.3, zorder=2)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.pca_biplot.md", "fidelity_checkpoints": [ { "feature": "浅样本点与载荷箭头", "preserve": "保留浅灰样本层、原点十字、载荷箭头与端点变量标签,不只画二维点云。", "allowed_adaptation": "PCA 得分、载荷、解释方差和显示缩放由实际分析确定,标签可以避让。", "evidence": [ { "line": 23, "end_line": 24, "code": "ax.scatter(scores[:, 0], scores[:, 1], s=25, alpha=0.35, color=COLORS['gray'],\n edgecolors='white', linewidths=0.3, zorder=2)", "href": "sources/advanced.pca_biplot/original.html#L23" }, { "line": 48, "end_line": 48, "code": "ax.axhline(0, color=COLORS['ref_line'], linewidth=0.5, alpha=0.4)", "href": "sources/advanced.pca_biplot/original.html#L48" }, { "line": 49, "end_line": 49, "code": "ax.axvline(0, color=COLORS['ref_line'], linewidth=0.5, alpha=0.4)", "href": "sources/advanced.pca_biplot/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.taylor", "display_name": "Taylor模型综合比较", "tags": [ "预测", "比较", "多维" ], "purpose": "模型相关、标准差与中心化误差怎样权衡?", "data_requirements": [ "参考标准差", "各模型相关系数与归一化标准差" ], "composition": "四分之一极坐标式统计图", "visual_features": [ "相关射线", "标准差弧", "RMSE参考弧", "模型点标签" ], "adaptation_notes": "当前角域主要覆盖非负相关;这里RMSE弧对应中心化差异,不等同含偏差总RMSE。", "number": 31, "kind": "recipe", "legacy_title": "Taylor Diagram — Taylor 图(多模型对比:相关系数 + 标准差 + RMSE)", "legacy_ref": "advanced #19", "source": { "original_code": "sources/advanced.taylor/original.py", "execution_code": "sources/advanced.taylor/render.py", "recipe_section": "sources/advanced.taylor/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "7dc646c5ba56142fb68f13bb3654f9b7de7d493ae6d166e92bc5a281eda37a3a", "code_sha256": "777ed9e184f89370c4f35740ba86b11329c5e4f2bb25795ebf6a823c14f600c3", "execution_sha256": "777ed9e184f89370c4f35740ba86b11329c5e4f2bb25795ebf6a823c14f600c3", "code_view": "sources/advanced.taylor/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.taylor-1.png", "thumbnail": "thumbnails/advanced.taylor-1.jpg", "sha256": "51754b58d3c53a0fd77a48dbbdbfa43bb8886de48f85c62646f811a12c222ff0", "pixels": [ 1260, 1260 ], "native_inches": [ 7.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 29, "operation": "plot", "code": " ax.plot(x_arc, y_arc, color=COLORS['grid'], linewidth=0.5, alpha=0.6)" }, { "line": 37, "operation": "plot", "code": " ax.plot(s * np.cos(theta_range), s * np.sin(theta_range), color=COLORS['grid'], linewidth=0.5, linestyle='--')" }, { "line": 48, "operation": "plot", "code": " ax.plot(cx[mask], cy[mask], color=COLORS['highlight'], linewidth=0.5, alpha=0.4, linestyle=':')" }, { "line": 52, "operation": "scatter", "code": "ax.scatter(ref_std, 0, s=150, color=COLORS['text'], marker='*', zorder=10, label='Observed')" }, { "line": 64, "operation": "scatter", "code": " ax.scatter(x, y, s=size, color=_lighten(color, 0.35), marker=marker, zorder=5, edgecolors=color, linewidths=1.8, label=name)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.taylor.md", "fidelity_checkpoints": [ { "feature": "统计参考弧和模型点", "preserve": "保留相关射线、标准差弧、RMSE 参考弧及观测参考星号,点在同一统计坐标体系内。", "allowed_adaptation": "模型数和尺度可变,按实际相关与标准差定位;负相关超出示例象限时扩展坐标结构。", "evidence": [ { "line": 29, "end_line": 29, "code": " ax.plot(x_arc, y_arc, color=COLORS['grid'], linewidth=0.5, alpha=0.6)", "href": "sources/advanced.taylor/original.html#L29" }, { "line": 37, "end_line": 38, "code": " ax.plot(s * np.cos(theta_range), s * np.sin(theta_range),\n color=COLORS['grid'], linewidth=0.5, linestyle='--')", "href": "sources/advanced.taylor/original.html#L37" }, { "line": 48, "end_line": 49, "code": " ax.plot(cx[mask], cy[mask], color=COLORS['highlight'], linewidth=0.5,\n alpha=0.4, linestyle=':')", "href": "sources/advanced.taylor/original.html#L48" }, { "line": 52, "end_line": 52, "code": "ax.scatter(ref_std, 0, s=150, color=COLORS['text'], marker='*', zorder=10, label='Observed')", "href": "sources/advanced.taylor/original.html#L52" }, { "line": 64, "end_line": 65, "code": " ax.scatter(x, y, s=size, color=_lighten(color, 0.35), marker=marker, zorder=5,\n edgecolors=color, linewidths=1.8, label=name)", "href": "sources/advanced.taylor/original.html#L64" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.diverging_bar", "display_name": "相对基线发散条形", "tags": [ "比较", "变化" ], "purpose": "各方法比基线好或差多少?", "data_requirements": [ "类别与有正负的相对变化值" ], "composition": "零线两侧横向条形", "visual_features": [ "方向配色", "浅填充深描边", "正负背景", "主方法行高亮" ], "adaptation_notes": "统一改善方向与百分比口径;不是组成堆叠图。", "number": 32, "kind": "recipe", "legacy_title": "Diverging Bar Chart — 发散柱状图(淡色填充 + 原色边框 + 相对基线 + 颜色编码方向 + 数值标签)", "legacy_ref": "advanced #20", "source": { "original_code": "sources/advanced.diverging_bar/original.py", "execution_code": "sources/advanced.diverging_bar/render.py", "recipe_section": "sources/advanced.diverging_bar/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "a8373e76381283e93e71571eb3c3d5ed2c12711b56accb740cf684a50cf4aa10", "code_sha256": "d536d5e66b820bec642f006bccdfbd355e0605aa2b791611e063e0085ea6a03a", "execution_sha256": "d536d5e66b820bec642f006bccdfbd355e0605aa2b791611e063e0085ea6a03a", "code_view": "sources/advanced.diverging_bar/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.diverging_bar-1.png", "thumbnail": "thumbnails/advanced.diverging_bar-1.jpg", "sha256": "9924c581135245debdf33d4416f4e3c62c7366f5598d4794cf565d033cbc1454", "pixels": [ 1440, 1062 ], "native_inches": [ 8.0, 5.8999999999999995 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "barh", "code": "ax.barh(y_pos + 0.03, deltas, height=0.5, color='#cccccc', alpha=0.1, zorder=1)" }, { "line": 25, "operation": "barh", "code": "bars = ax.barh(y_pos, deltas, height=0.5, color=[_lighten(c, 0.4) for c in base_colors], edgecolor=base_colors, linewidth=1.5, zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.waterfall", "competition.waterfall", "academic.ablation" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.diverging_bar.md", "fidelity_checkpoints": [ { "feature": "两向浅条与深边", "preserve": "保留零线两侧方向配色、浅填充深描边及后方阴影,正负背景和重点行仍可区分。", "allowed_adaptation": "类别数、排序、范围与重点对象可变;方向按真实差值解释,不固定谁有优势。", "evidence": [ { "line": 16, "end_line": 16, "code": "ax.axvspan(0, max(deltas)*1.3, alpha=0.05, color=COLORS['up'], zorder=0)", "href": "sources/advanced.diverging_bar/original.html#L16" }, { "line": 17, "end_line": 17, "code": "ax.axvspan(min(deltas)*1.3, 0, alpha=0.05, color=COLORS['down'], zorder=0)", "href": "sources/advanced.diverging_bar/original.html#L17" }, { "line": 23, "end_line": 23, "code": "ax.barh(y_pos + 0.03, deltas, height=0.5, color='#cccccc', alpha=0.1, zorder=1)", "href": "sources/advanced.diverging_bar/original.html#L23" }, { "line": 25, "end_line": 27, "code": "bars = ax.barh(y_pos, deltas, height=0.5,\n color=[_lighten(c, 0.4) for c in base_colors],\n edgecolor=base_colors, linewidth=1.5, zorder=3)", "href": "sources/advanced.diverging_bar/original.html#L25" }, { "line": 42, "end_line": 42, "code": "ax.axhspan(y_pos[0]-0.35, y_pos[0]+0.35, alpha=0.06, color=PALETTE[0], zorder=0)", "href": "sources/advanced.diverging_bar/original.html#L42" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.back_to_back_bar", "display_name": "两组镜像条形比较", "tags": [ "比较", "组合" ], "purpose": "两个群体在多个指标上的差距怎样?", "data_requirements": [ "每个指标的两组非负值" ], "composition": "共享类别轴;左右镜像横条", "visual_features": [ "浅填充深描边", "中心差值框", "左右数值标签" ], "adaptation_notes": "左侧负坐标仅用于镜像,实际量仍为正;不同单位指标需先可比化。", "number": 33, "kind": "recipe", "legacy_title": "Back-to-Back Bar Chart — 背靠背柱状图(浅色填充 + 原色边框 + 镜像对比 + 共享 Y 轴 + 差值标签)", "legacy_ref": "advanced #21", "source": { "original_code": "sources/advanced.back_to_back_bar/original.py", "execution_code": "sources/advanced.back_to_back_bar/render.py", "recipe_section": "sources/advanced.back_to_back_bar/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "09f593d0b0a81961871a5d23a2c6233b15a37b67a4e2eb1d36e30fe90b15b808", "code_sha256": "f0c3f92cabee84ebc83d04c3bd32365faa79a36627f168d3c8a6d7b58eac9000", "execution_sha256": "f0c3f92cabee84ebc83d04c3bd32365faa79a36627f168d3c8a6d7b58eac9000", "code_view": "sources/advanced.back_to_back_bar/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.back_to_back_bar-1.png", "thumbnail": "thumbnails/advanced.back_to_back_bar-1.jpg", "sha256": "0b091394e539497c7c23ac6aed94035a93670b4e76f3bfb8308b39bc04832496", "pixels": [ 1440, 936 ], "native_inches": [ 8.0, 5.199999999999999 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 16, "operation": "barh", "code": "bars_b = ax.barh(y_pos, [-v for v in group_b], height=0.55, color=_lighten(PALETTE[1], 0.4), edgecolor=PALETTE[1], linewidth=1.2, label='Baseline', zorder=3)" }, { "line": 20, "operation": "barh", "code": "bars_a = ax.barh(y_pos, group_a, height=0.55, color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0], linewidth=1.2, label='Ours', zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.back_to_back_bar.md", "fidelity_checkpoints": [ { "feature": "镜像条与中央差值", "preserve": "保留共享类别轴的两侧镜像条、浅填充深边与中央比较信息,不改成互相覆盖的同向柱。", "allowed_adaptation": "两组数据和行数可变,轴标签显示真实绝对量,镜像负坐标不代表负数据。", "evidence": [ { "line": 16, "end_line": 18, "code": "bars_b = ax.barh(y_pos, [-v for v in group_b], height=0.55,\n color=_lighten(PALETTE[1], 0.4), edgecolor=PALETTE[1],\n linewidth=1.2, label='Baseline', zorder=3)", "href": "sources/advanced.back_to_back_bar/original.html#L16" }, { "line": 20, "end_line": 22, "code": "bars_a = ax.barh(y_pos, group_a, height=0.55,\n color=_lighten(PALETTE[0], 0.4), edgecolor=PALETTE[0],\n linewidth=1.2, label='Ours', zorder=3)", "href": "sources/advanced.back_to_back_bar/original.html#L20" }, { "line": 26, "end_line": 27, "code": " ax.text(group_a[i] + 0.5, y_pos[i], f'{group_a[i]:.1f}',\n va='center', ha='left', fontsize=8.5, color=PALETTE[0], fontweight='bold')", "href": "sources/advanced.back_to_back_bar/original.html#L26" }, { "line": 28, "end_line": 29, "code": " ax.text(-group_b[i] - 0.5, y_pos[i], f'{group_b[i]:.1f}',\n va='center', ha='right', fontsize=8.5, color=PALETTE[1], fontweight='bold')", "href": "sources/advanced.back_to_back_bar/original.html#L28" }, { "line": 33, "end_line": 36, "code": " ax.text(0, y_pos[i], f'{sign}{gap:.1f}', va='center', ha='center',\n fontsize=7.5, fontweight='bold', color=COLORS['text'],\n bbox=dict(boxstyle='round,pad=0.2', facecolor='white',\n edgecolor=COLORS['grid'], alpha=0.9))", "href": "sources/advanced.back_to_back_bar/original.html#L33" }, { "line": 40, "end_line": 40, "code": "ax.axvline(0, color=COLORS['text'], linewidth=0.8)", "href": "sources/advanced.back_to_back_bar/original.html#L40" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.paired_dot", "display_name": "个体配对变化与均值箭头", "tags": [ "比较", "变化", "分布" ], "purpose": "同一批个体前后分别改变了多少?", "data_requirements": [ "个体ID对应的前后两次测量" ], "composition": "两列个体散点逐一连接;均值菱形", "visual_features": [ "细透明个体线", "粗均值连线", "变化箭头" ], "adaptation_notes": "需要真实配对关系;不能把独立两组样本按行连线;示例显著性文字需替换真实检验。", "number": 34, "kind": "recipe", "legacy_title": "Paired Dot Plot — 配对点图(个体变化连线 + 均值偏移箭头 + 显著性)", "legacy_ref": "advanced #22", "source": { "original_code": "sources/advanced.paired_dot/original.py", "execution_code": "sources/advanced.paired_dot/render.py", "recipe_section": "sources/advanced.paired_dot/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "9760e1a60f8e912bb54db0a6448d6a3e7fabfdfdd8fd1f4aa34ab194e5b26f63", "code_sha256": "a36e4b828bb773d2871f21049158b5db825372d5af2dc696107e8c7fe4a5cfcd", "execution_sha256": "a36e4b828bb773d2871f21049158b5db825372d5af2dc696107e8c7fe4a5cfcd", "code_view": "sources/advanced.paired_dot/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.paired_dot-1.png", "thumbnail": "thumbnails/advanced.paired_dot-1.jpg", "sha256": "afa77ccad71adb0710399664fa9c949aba5c7ea7ae65ada0535c240837c6edf0", "pixels": [ 900, 1080 ], "native_inches": [ 5.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 17, "operation": "plot", "code": " ax.plot([0, 1], [before[i], after[i]], color=color, alpha=0.35, linewidth=1.2, zorder=2)" }, { "line": 19, "operation": "scatter", "code": " ax.scatter([0, 1], [before[i], after[i]], color=color, s=30, edgecolors='white', linewidths=0.5, zorder=3, alpha=0.6)" }, { "line": 24, "operation": "scatter", "code": "ax.scatter(0, mean_before, s=200, color=PALETTE[1], marker='D', edgecolors='white', linewidths=2, zorder=5, label=f'Mean Before: {mean_before:.1f}')" }, { "line": 26, "operation": "scatter", "code": "ax.scatter(1, mean_after, s=200, color=PALETTE[0], marker='D', edgecolors='white', linewidths=2, zorder=5, label=f'Mean After: {mean_after:.1f}')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.dumbbell", "advanced.slope", "advanced.bump" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.paired_dot.md", "fidelity_checkpoints": [ { "feature": "个体细线和均值强调", "preserve": "保留逐个体半透明细连线、配对端点和均值菱形/变化箭头,区分个体变化与总体变化。", "allowed_adaptation": "按实际个体 ID 配对,样本密度与避让可调;没有配对关系时不连接。", "evidence": [ { "line": 17, "end_line": 18, "code": " ax.plot([0, 1], [before[i], after[i]], color=color, alpha=0.35,\n linewidth=1.2, zorder=2)", "href": "sources/advanced.paired_dot/original.html#L17" }, { "line": 19, "end_line": 20, "code": " ax.scatter([0, 1], [before[i], after[i]], color=color, s=30,\n edgecolors='white', linewidths=0.5, zorder=3, alpha=0.6)", "href": "sources/advanced.paired_dot/original.html#L19" }, { "line": 24, "end_line": 25, "code": "ax.scatter(0, mean_before, s=200, color=PALETTE[1], marker='D',\n edgecolors='white', linewidths=2, zorder=5, label=f'Mean Before: {mean_before:.1f}')", "href": "sources/advanced.paired_dot/original.html#L24" }, { "line": 26, "end_line": 27, "code": "ax.scatter(1, mean_after, s=200, color=PALETTE[0], marker='D',\n edgecolors='white', linewidths=2, zorder=5, label=f'Mean After: {mean_after:.1f}')", "href": "sources/advanced.paired_dot/original.html#L26" }, { "line": 30, "end_line": 32, "code": "ax.annotate('', xy=(1, mean_after), xytext=(0, mean_before),\n arrowprops=dict(arrowstyle='->', color=COLORS['text'], lw=2.5,\n connectionstyle='arc3,rad=0.15'))", "href": "sources/advanced.paired_dot/original.html#L30" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.ridgeline", "display_name": "堆叠山脊密度", "tags": [ "分布", "比较" ], "purpose": "较多组的分布峰值、宽度与偏移如何?", "data_requirements": [ "分组原始连续样本" ], "composition": "多条密度曲线逐行上移并部分重叠", "visual_features": [ "浅填充深轮廓", "中位数虚线", "末端组名" ], "adaptation_notes": "当前代码为单层均匀填充,注释Gradient fill并未实现内部渐变;密度高度归一化不表达样本量。", "number": 35, "kind": "recipe", "legacy_title": "Ridgeline Plot — 山脊图(堆叠分布对比 + 渐变填充 + 中位数线)", "legacy_ref": "advanced #23", "source": { "original_code": "sources/advanced.ridgeline/original.py", "execution_code": "sources/advanced.ridgeline/render.py", "recipe_section": "sources/advanced.ridgeline/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "4a843950d6056321ad40bbcbaee27364007113de08a445238036b1168ef0f270", "code_sha256": "db9b89f16e1cbcbda46879340dc9cd4653c7a02e8d348128cb3f457c64f2f550", "execution_sha256": "db9b89f16e1cbcbda46879340dc9cd4653c7a02e8d348128cb3f457c64f2f550", "code_view": "sources/advanced.ridgeline/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.ridgeline-1.png", "thumbnail": "thumbnails/advanced.ridgeline-1.jpg", "sha256": "a9ac17e161e838b2ff847607954dbf919b4b88fdaa1873050ca5c9d6b2f95c99", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 36, "operation": "fill_between", "code": " ax.fill_between(x_grid, baseline, baseline + density, color=light, alpha=0.85, zorder=n_groups - i)" }, { "line": 38, "operation": "plot", "code": " ax.plot(x_grid, baseline + density, color=color, linewidth=1.5, zorder=n_groups - i + 0.5)" }, { "line": 44, "operation": "plot", "code": " ax.plot([median, median], [baseline, baseline + med_density], color=color, linewidth=1.5, linestyle='--', alpha=0.7, zorder=n_groups - i + 1)" } ], "literal_colormaps": [], "aliases": [ "ridgeline", "joyplot", "密度山脊" ], "related_ids": [ "basic.raincloud", "basic.raincloud_violin", "advanced.grouped_violin", "empirical.raincloud", "academic.confusion_matrix", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.ridgeline.md", "fidelity_checkpoints": [ { "feature": "浅填充和错落山脊", "preserve": "保留 _lighten(color,0.5) 的单层浅填充、alpha=0.85、独立深轮廓和由后到前的遮叠顺序;原代码没有连续渐变。", "allowed_adaptation": "组数、密度带宽、间距和重叠程度可调;重新计算中位数,线段高度与当前密度归一化一致。", "evidence": [ { "line": 36, "end_line": 37, "code": " ax.fill_between(x_grid, baseline, baseline + density,\n color=light, alpha=0.85, zorder=n_groups - i)", "href": "sources/advanced.ridgeline/original.html#L36" }, { "line": 38, "end_line": 39, "code": " ax.plot(x_grid, baseline + density, color=color, linewidth=1.5,\n zorder=n_groups - i + 0.5)", "href": "sources/advanced.ridgeline/original.html#L38" }, { "line": 44, "end_line": 46, "code": " ax.plot([median, median], [baseline, baseline + med_density],\n color=color, linewidth=1.5, linestyle='--', alpha=0.7,\n zorder=n_groups - i + 1)", "href": "sources/advanced.ridgeline/original.html#L44" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.grouped_violin", "display_name": "类别内多方法小提琴", "tags": [ "分布", "比较" ], "purpose": "多个数据集内各方法的重复结果分布如何?", "data_requirements": [ "外层类别×方法", "每组合的原始样本" ], "composition": "每个类别内并排多把完整小提琴", "visual_features": [ "浅色琴体", "深轮廓", "中位数和四分位线" ], "adaptation_notes": "双重分组太多时拥挤;不能用单个平均值虚构密度。", "number": 36, "kind": "recipe", "legacy_title": "Grouped Violin Plot (Multi-Group Distribution Comparison + Median + Quartile Lines)", "legacy_ref": "advanced #24", "source": { "original_code": "sources/advanced.grouped_violin/original.py", "execution_code": "sources/advanced.grouped_violin/render.py", "recipe_section": "sources/advanced.grouped_violin/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "eea71c29f841a4506d943538c5b33ed4d4f751251a9c732cf7e7c872146a4a2c", "code_sha256": "ccdfcf28a0a5c6485107fbecdc1416d8953a8f0e40582373b941c4c303a8865d", "execution_sha256": "ccdfcf28a0a5c6485107fbecdc1416d8953a8f0e40582373b941c4c303a8865d", "code_view": "sources/advanced.grouped_violin/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.grouped_violin-1.png", "thumbnail": "thumbnails/advanced.grouped_violin-1.jpg", "sha256": "ff8b184618eccc0348d6c646de4b7d85b98c40bf4776de09454df393db941b4a", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 29, "operation": "violinplot", "code": " parts = ax.violinplot(all_data[gname], positions=positions, widths=width * 0.85, showmeans=False, showmedians=False, showextrema=False)" }, { "line": 44, "operation": "scatter", "code": " ax.scatter(pos, med, color=color, s=30, zorder=5, edgecolors='white', linewidths=0.8)" }, { "line": 50, "operation": "scatter", "code": " ax.scatter([], [], color=color, s=60, label=gname, edgecolors='white')" } ], "literal_colormaps": [], "aliases": [ "grouped violin", "双因素分组分布" ], "related_ids": [ "basic.raincloud", "basic.raincloud_violin", "advanced.ridgeline", "empirical.raincloud", "academic.confusion_matrix", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.grouped_violin.md", "fidelity_checkpoints": [ { "feature": "浅琴体和深描边是两个设置", "preserve": "保留 _lighten 的填色处理、独立边线与 alpha=0.8 的琴体;不要把填充和轮廓同时设成同一实色。", "allowed_adaptation": "色相跟随已选配色,组数、并排位置和宽度适配类别数量;浅深关系继续保留。", "evidence": [ { "line": 25, "end_line": 38, "code": " positions = positions_base + (g - n_groups / 2 + 0.5) * width\n color = PALETTE[g % len(PALETTE)]\n light = _lighten(color, 0.4)\n\n parts = ax.violinplot(all_data[gname], positions=positions,\n widths=width * 0.85, showmeans=False,\n showmedians=False, showextrema=False)\n\n for pc in parts['bodies']:\n pc.set_facecolor(light)\n pc.set_edgecolor(color)\n pc.set_linewidth(1.2)\n pc.set_alpha(0.8)\n", "href": "sources/advanced.grouped_violin/original.html#L25" } ] }, { "feature": "中位数与四分位线", "preserve": "保留白边中位数点与较粗的 Q1–Q3 竖线,不把统计层简化成无内部信息的琴体。", "allowed_adaptation": "分位数来自每组有效原始样本;布局和线长随数据变化,不复制示例数值。", "evidence": [ { "line": 40, "end_line": 50, "code": " for i, d in enumerate(all_data[gname]):\n q1, med, q3 = np.percentile(d, [25, 50, 75])\n pos = positions[i]\n # Median dot\n ax.scatter(pos, med, color=color, s=30, zorder=5,\n edgecolors='white', linewidths=0.8)\n # Quartile whisker\n ax.vlines(pos, q1, q3, color=color, linewidth=2.5, zorder=4)\n\n # Invisible scatter for legend\n ax.scatter([], [], color=color, s=60, label=gname, edgecolors='white')", "href": "sources/advanced.grouped_violin/original.html#L40" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.performance_profile", "display_name": "Dolan–Moré性能剖面", "tags": [ "比较", "排序", "优化" ], "purpose": "算法跨多个问题的胜率与稳健性怎样?", "data_requirements": [ "问题×算法的正耗时或成本矩阵", "失败状态" ], "composition": "对数性能比横轴;累计问题占比阶梯", "visual_features": [ "不同点形和线型", "主算法突出", "τ=1胜率标注" ], "adaptation_notes": "比较的是相对每题最佳成本;零成本、失败和超时需明确处理;不是单问题收敛曲线。", "number": 37, "kind": "recipe", "legacy_title": "Performance Profile (Dolan-Moré) — 性能剖面图(多算法跨问题对比标准画法)", "legacy_ref": "advanced #25", "source": { "original_code": "sources/advanced.performance_profile/original.py", "execution_code": "sources/advanced.performance_profile/render.py", "recipe_section": "sources/advanced.performance_profile/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "a821b77c8c8ef2c0fa5eca9aca3eb3870d1be0f317621efe85ce28f143afda9b", "code_sha256": "7ca521f442c40e1a26d09cd45991480e4b7e2c6012231684b2e57d5d7fda9b18", "execution_sha256": "7ca521f442c40e1a26d09cd45991480e4b7e2c6012231684b2e57d5d7fda9b18", "code_view": "sources/advanced.performance_profile/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.performance_profile-1.png", "thumbnail": "thumbnails/advanced.performance_profile-1.jpg", "sha256": "010dbff62ddbd28123066856b94cbcd85b25883c9ccf815740337d5ecbd743d3", "pixels": [ 1260, 810 ], "native_inches": [ 7.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 37, "operation": "step", "code": " ax.step(tau_grid, rho[:, s], where='post', color=PALETTE[s % len(PALETTE)], linewidth=lw, alpha=alpha, marker=markers[s % len(markers)], markersize=5," } ], "literal_colormaps": [], "aliases": [ "Dolan More", "求解器基准", "性能比累计分布" ], "related_ids": [ "competition.convergence", "academic.training_curves" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.performance_profile.md", "fidelity_checkpoints": [ { "feature": "性能比的累计阶梯", "preserve": "保留累计比例阶梯、对数性能比轴及方法线型/点形主次,不用平滑曲线替换经验阶梯。", "allowed_adaptation": "求解器、问题集和失败处理按实际计算,τ=1 胜率标注重算。", "evidence": [ { "line": 37, "end_line": 42, "code": " ax.step(tau_grid, rho[:, s], where='post',\n color=PALETTE[s % len(PALETTE)],\n linewidth=lw, alpha=alpha,\n marker=markers[s % len(markers)], markersize=5,\n markevery=20, markeredgecolor='white', markeredgewidth=0.6,\n label=name + (' ★' if is_self else ''))", "href": "sources/advanced.performance_profile/original.html#L37" }, { "line": 48, "end_line": 51, "code": " ax.text(1.02, rho0, f'{rho0:.2f}', fontsize=7,\n color=PALETTE[s % len(PALETTE)], va='center', ha='left',\n bbox=dict(boxstyle='round,pad=0.15', facecolor='white',\n edgecolor=PALETTE[s % len(PALETTE)], alpha=0.85, linewidth=0.4))", "href": "sources/advanced.performance_profile/original.html#L48" }, { "line": 55, "end_line": 56, "code": "ax.text(tau_grid[-1] * 0.95, 1.01, 'Ideal solver (ρ=1)',\n fontsize=7, color=COLORS['ref_line'], ha='right', va='bottom', style='italic')", "href": "sources/advanced.performance_profile/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.ice_pdp", "display_name": "ICE个体响应与PDP组合", "tags": [ "解释", "趋势", "分布", "组合" ], "purpose": "特征变化如何影响个体及平均预测?", "data_requirements": [ "特征网格", "每个样本的模型响应", "真实特征样本" ], "composition": "上方ICE细线与PDP;下方特征直方图", "visual_features": [ "低透明度曲线群形成密度感", "粗均值线", "单层分位范围", "拐点标注" ], "adaptation_notes": "示例响应是模拟函数;个体差异带不等同均值置信区间;相关特征下需注意干预解释。", "number": 38, "kind": "recipe", "legacy_title": "ICE + PDP — 可解释机器学习(多条 ICE 细线 + 粗 PDP 均值线 + 边际分布)", "legacy_ref": "advanced #26", "source": { "original_code": "sources/advanced.ice_pdp/original.py", "execution_code": "sources/advanced.ice_pdp/render.py", "recipe_section": "sources/advanced.ice_pdp/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "a933ccc21e069bb321539aedfafd727371744bdc6363cfd1f40c17632f1f2977", "code_sha256": "d19f687669a18282268955d9afca3c3bc7ed4f93d6c90bc9b32f55ec3f06f2fd", "execution_sha256": "d19f687669a18282268955d9afca3c3bc7ed4f93d6c90bc9b32f55ec3f06f2fd", "code_view": "sources/advanced.ice_pdp/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.ice_pdp-1.png", "thumbnail": "thumbnails/advanced.ice_pdp-1.jpg", "sha256": "24b4ed6afc446b1591bc1e0666eba0e85840f288d1ed6f4862c2df7fc64e3a41", "pixels": [ 1260, 936 ], "native_inches": [ 7.0, 5.2 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 35, "operation": "plot", "code": " ax.plot(x_grid, ice_curves[i], color=PALETTE[0], linewidth=0.5, alpha=0.06, zorder=1)" }, { "line": 38, "operation": "fill_between", "code": "ax.fill_between(x_grid, pdp_ci_lo, pdp_ci_hi, color=_lighten(PALETTE[0], 0.55), alpha=0.45, linewidth=0, zorder=2, label='90% 区间')" }, { "line": 42, "operation": "plot", "code": "ax.plot(x_grid, pdp, color=PALETTE[0], linewidth=2.6, zorder=3, label='PDP (均值)')" }, { "line": 44, "operation": "plot", "code": "ax.plot(x_grid, pdp, color='white', linewidth=4.5, zorder=2.5, alpha=0.6)" }, { "line": 45, "operation": "plot", "code": "ax.plot(x_grid, pdp, color=PALETTE[0], linewidth=2.6, zorder=3)" }, { "line": 49, "operation": "scatter", "code": "ax.scatter([x_grid[turn_idx]], [pdp[turn_idx]], s=80, color=COLORS['highlight'], edgecolor='white', linewidth=1.5, zorder=5, marker='o')" }, { "line": 67, "operation": "hist", "code": "ax_marg.hist(x_samples, bins=40, color=_lighten(PALETTE[0], 0.4), alpha=0.85, edgecolor=PALETTE[0], linewidth=0.4)" } ], "literal_colormaps": [], "aliases": [ "ICE", "PDP", "partial dependence", "个体条件期望" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.ice_pdp.md", "fidelity_checkpoints": [ { "feature": "细曲线群与白色衬边主线", "preserve": "保留低 alpha 的 ICE 曲线群、浅色单层分位范围和带白色衬边的粗 PDP 均值线,以及下方特征直方图。源码没有额外 rug 或多层区间。", "allowed_adaptation": "样本数、特征网格与直方分箱可变;该范围来自个体曲线分位数,不自动称为 PDP 估计置信区间。", "evidence": [ { "line": 35, "end_line": 35, "code": " ax.plot(x_grid, ice_curves[i], color=PALETTE[0], linewidth=0.5, alpha=0.06, zorder=1)", "href": "sources/advanced.ice_pdp/original.html#L35" }, { "line": 38, "end_line": 39, "code": "ax.fill_between(x_grid, pdp_ci_lo, pdp_ci_hi, color=_lighten(PALETTE[0], 0.55),\n alpha=0.45, linewidth=0, zorder=2, label='90% 区间')", "href": "sources/advanced.ice_pdp/original.html#L38" }, { "line": 42, "end_line": 42, "code": "ax.plot(x_grid, pdp, color=PALETTE[0], linewidth=2.6, zorder=3, label='PDP (均值)')", "href": "sources/advanced.ice_pdp/original.html#L42" }, { "line": 44, "end_line": 44, "code": "ax.plot(x_grid, pdp, color='white', linewidth=4.5, zorder=2.5, alpha=0.6)", "href": "sources/advanced.ice_pdp/original.html#L44" }, { "line": 45, "end_line": 45, "code": "ax.plot(x_grid, pdp, color=PALETTE[0], linewidth=2.6, zorder=3)", "href": "sources/advanced.ice_pdp/original.html#L45" }, { "line": 67, "end_line": 68, "code": "ax_marg.hist(x_samples, bins=40, color=_lighten(PALETTE[0], 0.4), alpha=0.85,\n edgecolor=PALETTE[0], linewidth=0.4)", "href": "sources/advanced.ice_pdp/original.html#L67" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.fan", "display_name": "历史与预测分位数扇形图", "tags": [ "预测", "趋势", "误差" ], "purpose": "未来趋势及逐步扩大的不确定性怎样?", "data_requirements": [ "历史序列", "未来中位数与多组分位数" ], "composition": "单面板;历史与预测分隔", "visual_features": [ "三档嵌套透明区间", "历史实线、预测虚线", "终点范围" ], "adaptation_notes": "分位数应有序且来源一致;示例扩散范围为模拟,不是已拟合预测器输出。", "number": 39, "kind": "recipe", "legacy_title": "Fan Chart — 预测扇形图(多层 CI 带 + 历史/预测分隔 + 中位数线)", "legacy_ref": "advanced #27", "source": { "original_code": "sources/advanced.fan/original.py", "execution_code": "sources/advanced.fan/render.py", "recipe_section": "sources/advanced.fan/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "47fa24be68ef03c214a2a5e3516d655990331c6ecceb6c3abeaa7fa6af4466f1", "code_sha256": "833691c24e69a8263f2eadf5222eced3587f65283c6fa15094729ffa244b9a04", "execution_sha256": "833691c24e69a8263f2eadf5222eced3587f65283c6fa15094729ffa244b9a04", "code_view": "sources/advanced.fan/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.fan-1.png", "thumbnail": "thumbnails/advanced.fan-1.jpg", "sha256": "a51bfc0ddd18779b834f4cdd3cae9df962cf2e8157603e51b3a543f7502867ce", "pixels": [ 1440, 810 ], "native_inches": [ 8.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "plot", "code": "ax.plot(t[:n_hist], hist, color=COLORS['text'], linewidth=1.8, zorder=4, label='历史值')" }, { "line": 27, "operation": "scatter", "code": "ax.scatter(t[n_hist-1], hist[-1], s=50, color=COLORS['text'], zorder=5, edgecolor='white', linewidth=1)" }, { "line": 37, "operation": "fill_between", "code": "ax.fill_between(t_pred, quant_full['p05'], quant_full['p95'], color=_lighten(PALETTE[0], 0.65), alpha=0.55, linewidth=0, label='95% 区间', zorder=1)" }, { "line": 41, "operation": "fill_between", "code": "ax.fill_between(t_pred, quant_full['p10'], quant_full['p90'], color=_lighten(PALETTE[0], 0.4), alpha=0.7, linewidth=0, label='80% 区间', zorder=2)" }, { "line": 45, "operation": "fill_between", "code": "ax.fill_between(t_pred, quant_full['p25'], quant_full['p75'], color=_lighten(PALETTE[0], 0.2), alpha=0.8, linewidth=0, label='50% 区间', zorder=3)" }, { "line": 49, "operation": "plot", "code": "ax.plot(t_pred, pred_full, color=PALETTE[0], linewidth=1.8, linestyle='--', zorder=4, label='中位数预测')" } ], "literal_colormaps": [], "aliases": [ "fan chart", "预测区间", "分位数带" ], "related_ids": [ "empirical.prediction_ci", "advanced.calibration", "competition.prediction_actual" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.fan.md", "fidelity_checkpoints": [ { "feature": "分位扇形的三档层次", "preserve": "保留由浅到深的三档嵌套分位带、历史实线与预测虚线、历史末点与预测衔接,不改成单个误差带。", "allowed_adaptation": "分位数、预测长度和分界随真实预测更新,不能套用折线图的透明度顺序或模拟宽度。", "evidence": [ { "line": 26, "end_line": 26, "code": "ax.plot(t[:n_hist], hist, color=COLORS['text'], linewidth=1.8, zorder=4, label='历史值')", "href": "sources/advanced.fan/original.html#L26" }, { "line": 27, "end_line": 28, "code": "ax.scatter(t[n_hist-1], hist[-1], s=50, color=COLORS['text'], zorder=5,\n edgecolor='white', linewidth=1)", "href": "sources/advanced.fan/original.html#L27" }, { "line": 37, "end_line": 39, "code": "ax.fill_between(t_pred, quant_full['p05'], quant_full['p95'],\n color=_lighten(PALETTE[0], 0.65), alpha=0.55, linewidth=0,\n label='95% 区间', zorder=1)", "href": "sources/advanced.fan/original.html#L37" }, { "line": 41, "end_line": 43, "code": "ax.fill_between(t_pred, quant_full['p10'], quant_full['p90'],\n color=_lighten(PALETTE[0], 0.4), alpha=0.7, linewidth=0,\n label='80% 区间', zorder=2)", "href": "sources/advanced.fan/original.html#L41" }, { "line": 45, "end_line": 47, "code": "ax.fill_between(t_pred, quant_full['p25'], quant_full['p75'],\n color=_lighten(PALETTE[0], 0.2), alpha=0.8, linewidth=0,\n label='50% 区间', zorder=3)", "href": "sources/advanced.fan/original.html#L45" }, { "line": 49, "end_line": 50, "code": "ax.plot(t_pred, pred_full, color=PALETTE[0], linewidth=1.8, linestyle='--', zorder=4,\n label='中位数预测')", "href": "sources/advanced.fan/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.calendar_heatmap", "display_name": "日历格点热图", "tags": [ "时间", "矩阵" ], "purpose": "全年活动强度、周规律和异常日在哪里?", "data_requirements": [ "每日日期和值" ], "composition": "周列×星期行;月份分隔;横向色条", "visual_features": [ "主色浅到深连续色阶", "紧凑方格", "异常日标注" ], "adaptation_notes": "缺失日期不能当零;跨年、闰年和周编号边界需按实际日期适配。", "number": 40, "kind": "recipe", "legacy_title": "Calendar Heatmap — 日历热图(一年 7×53 网格 + 月份分隔 + 顶部色条)", "legacy_ref": "advanced #28", "source": { "original_code": "sources/advanced.calendar_heatmap/original.py", "execution_code": "sources/advanced.calendar_heatmap/render.py", "recipe_section": "sources/advanced.calendar_heatmap/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "a6f98186e891864b0ce417d847c44f58d93e20fbf067947353b52fa6de51e62a", "code_sha256": "289cc4b1bcf47bc6017d46c17d52facfa641d579ba40bd799c8f58befbacfe42", "execution_sha256": "289cc4b1bcf47bc6017d46c17d52facfa641d579ba40bd799c8f58befbacfe42", "code_view": "sources/advanced.calendar_heatmap/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.calendar_heatmap-1.png", "thumbnail": "thumbnails/advanced.calendar_heatmap-1.jpg", "sha256": "fed5a95620a04d33b7518b47ff28ba0612e126118633600f8b304f3cf50064d4", "pixels": [ 1980, 468 ], "native_inches": [ 11.0, 2.6 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 42, "operation": "imshow", "code": "im = ax.imshow(grid, aspect='equal', cmap=cmap_calendar, vmin=0," }, { "line": 73, "operation": "add_patch", "code": "ax.add_patch(Rectangle((wk - 0.45, wd - 0.45), 0.9, 0.9," } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.calendar_heatmap.md", "fidelity_checkpoints": [ { "feature": "周日格网与连续深浅", "preserve": "保留按周列/星期行排列的格网、浅到深连续色阶、月份边界和异常日框,不当普通矩阵任意重排。", "allowed_adaptation": "日期跨度、量纲和色阶范围可变;无观测日期与零值区分,异常日按当前规则确定。", "evidence": [ { "line": 42, "end_line": 43, "code": "im = ax.imshow(grid, aspect='equal', cmap=cmap_calendar, vmin=0,\n vmax=np.nanpercentile(grid, 98))", "href": "sources/advanced.calendar_heatmap/original.html#L42" }, { "line": 61, "end_line": 62, "code": "cbar = fig.colorbar(im, ax=ax, orientation='horizontal', shrink=0.35,\n pad=0.25, aspect=30)", "href": "sources/advanced.calendar_heatmap/original.html#L61" }, { "line": 73, "end_line": 75, "code": " ax.add_patch(Rectangle((wk - 0.45, wd - 0.45), 0.9, 0.9,\n fill=False, edgecolor=COLORS['highlight'],\n linewidth=1.3, zorder=5))", "href": "sources/advanced.calendar_heatmap/original.html#L73" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.hovmoller", "display_name": "Hovmöller时空异常图", "tags": [ "空间", "时间", "矩阵" ], "purpose": "空间异常怎样随时间传播和持续?", "data_requirements": [ "时间×空间坐标的数值矩阵", "异常基准" ], "composition": "时间纵轴、空间横轴;侧色条", "visual_features": [ "红蓝异常色阶", "等值线", "事件框" ], "adaptation_notes": "适合有序空间轴而非任意类别;以零为中心的含义需成立;事件框为示例。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 41, "kind": "recipe", "legacy_title": "Hovmöller — 时空双轴图(时间纵 + 空间横 + 偏离均值色阶 + 事件标注)", "legacy_ref": "advanced #29", "source": { "original_code": "sources/advanced.hovmoller/original.py", "execution_code": "sources/advanced.hovmoller/render.py", "recipe_section": "sources/advanced.hovmoller/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "46267dd3f6cb9aee4e81f99af3bc1446ff1d90eb9b9b938cbaae703271b7eeaf", "code_sha256": "0a05f220dcb36d0890e8d85d304223c2986ec7387e0ee7bcb35cb88ae70f56c3", "execution_sha256": "0a05f220dcb36d0890e8d85d304223c2986ec7387e0ee7bcb35cb88ae70f56c3", "code_view": "sources/advanced.hovmoller/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.hovmoller-1.png", "thumbnail": "thumbnails/advanced.hovmoller-1.jpg", "sha256": "d49b0a6c2524c89c905d49c048f8b2b3e57cbfc4654987d5122a7be1513ff2a5", "pixels": [ 1435, 1083 ], "native_inches": [ 7.0, 5.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 25, "operation": "imshow", "code": "im = ax.imshow(data, aspect='auto', cmap=palette_cmap('diverging'), vmin=-v, vmax=v," }, { "line": 30, "operation": "contour", "code": "cs = ax.contour(lons, months, data, levels=[0], colors=[COLORS['ref_line']]," }, { "line": 35, "operation": "add_patch", "code": "ax.add_patch(Rectangle((lons[10], 15), lons[30] - lons[10], 10," }, { "line": 43, "operation": "add_patch", "code": "ax.add_patch(Rectangle((lons[20], 40), lons[35] - lons[20], 8," } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.hovmoller.md", "fidelity_checkpoints": [ { "feature": "异常色阶和零等值线", "preserve": "保留时间—空间坐标、以零为中心的正负异常色阶、零等值线与有依据的事件框。", "allowed_adaptation": "时间范围、空间方向、连续色相和显示分辨率可变,不因美化颠倒时间或抹去正负含义。", "evidence": [ { "line": 25, "end_line": 27, "code": "im = ax.imshow(data, aspect='auto', cmap=palette_cmap('diverging'), vmin=-v, vmax=v,\n extent=[lons[0], lons[-1], months[-1], months[0]],\n interpolation='bilinear')", "href": "sources/advanced.hovmoller/original.html#L25" }, { "line": 30, "end_line": 31, "code": "cs = ax.contour(lons, months, data, levels=[0], colors=[COLORS['ref_line']],\n linewidths=0.6, alpha=0.5, linestyles='--')", "href": "sources/advanced.hovmoller/original.html#L30" }, { "line": 35, "end_line": 37, "code": "ax.add_patch(Rectangle((lons[10], 15), lons[30] - lons[10], 10,\n fill=False, edgecolor=COLORS['highlight'],\n linewidth=1.4, linestyle='-', zorder=5))", "href": "sources/advanced.hovmoller/original.html#L35" }, { "line": 43, "end_line": 45, "code": "ax.add_patch(Rectangle((lons[20], 40), lons[35] - lons[20], 8,\n fill=False, edgecolor=PALETTE[0],\n linewidth=1.4, linestyle='-', zorder=5))", "href": "sources/advanced.hovmoller/original.html#L43" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.pair_plot", "display_name": "分布与Pearson成对关系矩阵", "tags": [ "关联", "分布", "多维", "组合" ], "purpose": "多个变量各自怎样分布、两两怎样相关?", "data_requirements": [ "样本×连续变量矩阵", "变量名" ], "composition": "N×N矩阵:对角直方图与KDE,下三角散点回归,上三角相关系数", "visual_features": [ "正负相关背景色", "字号随强度", "显著性星号", "边缘共用标签" ], "adaptation_notes": "需要原始样本才能同时画密度和散点;变量过多时矩阵增长很快;不同于左侧另加残差小提琴的完整组合。", "number": 42, "kind": "recipe", "legacy_title": "Pair Plot / Scatter Matrix — 配对图(对角线 KDE + 上三角相关系数 + 下三角散点拟合)", "legacy_ref": "advanced #30", "source": { "original_code": "sources/advanced.pair_plot/original.py", "execution_code": "sources/advanced.pair_plot/render.py", "recipe_section": "sources/advanced.pair_plot/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "65efa9c00b85df8f7e73edf573a020bed417170cd0f37c090b11c979b1c23615", "code_sha256": "d8a54b298b57f5b27dd1ccbf78aabb241e9718d33501e525d6b8d802fd493ad9", "execution_sha256": "d8a54b298b57f5b27dd1ccbf78aabb241e9718d33501e525d6b8d802fd493ad9", "code_view": "sources/advanced.pair_plot/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.pair_plot-1.png", "thumbnail": "thumbnails/advanced.pair_plot-1.jpg", "sha256": "5fef28e8a1c1e6b7a48df7b1a737db3c93d33015bbb06373a2d936aeb9693476", "pixels": [ 1530, 1530 ], "native_inches": [ 8.5, 8.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "hist", "code": " ax.hist(data[:, i], bins=22, color=_lighten(PALETTE[i % len(PALETTE)], 0.55), edgecolor=PALETTE[i % len(PALETTE)], linewidth=0.5, alpha=0.85)" }, { "line": 30, "operation": "plot", "code": " ax2.plot(xg, gaussian_kde(data[:, i])(xg), color=PALETTE[i % len(PALETTE)], linewidth=1.5)" }, { "line": 41, "operation": "scatter", "code": " ax.scatter(data[:, j], data[:, i], s=10, alpha=0.35, color=PALETTE[0], edgecolor='white', linewidth=0.2)" }, { "line": 47, "operation": "plot", "code": " ax.plot(xfit, yfit, color=COLORS['highlight'], linewidth=1.4, alpha=0.85, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "pair plot", "pairplot", "pairgrid", "scatter matrix", "散点矩阵", "Pearson", "分布与相关关系", "成对关系", "问卷变量关系" ], "related_ids": [ "template.sem_violin_pearson", "empirical.correlation_heatmap", "competition.correlation_matrix", "basic.heatmap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.pair_plot.md", "fidelity_checkpoints": [ { "feature": "三角分工的成对矩阵", "preserve": "保留对角分布与 KDE、下三角透明散点和回归、上三角相关数值/背景及边缘标签;三部分分工不可压成重复散点。", "allowed_adaptation": "变量数、样本与标签可变;相关、星号、回归和密度均重新计算,退化变量按数据处理。", "evidence": [ { "line": 26, "end_line": 27, "code": " ax.hist(data[:, i], bins=22, color=_lighten(PALETTE[i % len(PALETTE)], 0.55),\n edgecolor=PALETTE[i % len(PALETTE)], linewidth=0.5, alpha=0.85)", "href": "sources/advanced.pair_plot/original.html#L26" }, { "line": 30, "end_line": 31, "code": " ax2.plot(xg, gaussian_kde(data[:, i])(xg),\n color=PALETTE[i % len(PALETTE)], linewidth=1.5)", "href": "sources/advanced.pair_plot/original.html#L30" }, { "line": 36, "end_line": 38, "code": " ax.text(0.05, 0.92, names[i], transform=ax.transAxes,\n fontsize=11, fontweight='bold', color=PALETTE[i % len(PALETTE)],\n va='top', ha='left')", "href": "sources/advanced.pair_plot/original.html#L36" }, { "line": 41, "end_line": 42, "code": " ax.scatter(data[:, j], data[:, i], s=10, alpha=0.35,\n color=PALETTE[0], edgecolor='white', linewidth=0.2)", "href": "sources/advanced.pair_plot/original.html#L41" }, { "line": 47, "end_line": 48, "code": " ax.plot(xfit, yfit, color=COLORS['highlight'], linewidth=1.4,\n alpha=0.85, zorder=5)", "href": "sources/advanced.pair_plot/original.html#L47" }, { "line": 57, "end_line": 57, "code": " ax.set_facecolor(bg)", "href": "sources/advanced.pair_plot/original.html#L57" }, { "line": 60, "end_line": 62, "code": " ax.text(0.5, 0.55, f'{r:+.2f}', transform=ax.transAxes,\n fontsize=fs, fontweight='bold',\n color=COLORS['text'], ha='center', va='center')", "href": "sources/advanced.pair_plot/original.html#L60" }, { "line": 64, "end_line": 65, "code": " ax.text(0.5, 0.18, sig, transform=ax.transAxes,\n fontsize=11, color=COLORS['text'], ha='center')", "href": "sources/advanced.pair_plot/original.html#L64" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.triptych", "display_name": "输入—中间响应—输出三联图", "tags": [ "组合", "图像", "解释" ], "purpose": "处理过程前后发生了什么,中间关注哪里?", "data_requirements": [ "三张空间可对齐的二维标量图", "共同数值范围" ], "composition": "横向三面板;顶部共享色条;面板间箭头", "visual_features": [ "相同连续色阶", "空间结构对照", "流程指向" ], "adaptation_notes": "实际使用viridis,非分类色板;不同量纲图不能强行共享色条;预览顶部刻度与标题邻近。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 43, "kind": "recipe", "legacy_title": "Triptych — 三联图(input / 中间表示 / output 横向对比 + 流向箭头)", "legacy_ref": "advanced #31", "source": { "original_code": "sources/advanced.triptych/original.py", "execution_code": "sources/advanced.triptych/render.py", "recipe_section": "sources/advanced.triptych/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "2d81d215d00d7d5ba9b524e7499ea86c7c7de064797e394da2878abd849f50e2", "code_sha256": "fc47571251183bf3341bf8d0098ba246d4f37bea0f37c6911a9afe97fe076d19", "execution_sha256": "fc47571251183bf3341bf8d0098ba246d4f37bea0f37c6911a9afe97fe076d19", "code_view": "sources/advanced.triptych/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.triptych-1.png", "thumbnail": "thumbnails/advanced.triptych-1.jpg", "sha256": "828439a29d5c3cae00d8e84483e5988e8e64ae5c9e65bacd2dc744b1598c071d", "pixels": [ 1602, 732 ], "native_inches": [ 9.0, 4.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 30, "operation": "imshow", "code": "im = ax.imshow(images[col], cmap=palette_cmap('sequential'), vmin=0, vmax=v," } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.triptych.md", "fidelity_checkpoints": [ { "feature": "三面板共用数值尺度", "preserve": "保留横向三联图、共享色条与相同归一化范围,面板间箭头表达实际处理次序。", "allowed_adaptation": "网格大小和布局间距可变;比较同量纲量时不可每面板独立拉伸色阶制造差异。", "evidence": [ { "line": 30, "end_line": 31, "code": " im = ax.imshow(images[col], cmap=palette_cmap('sequential'), vmin=0, vmax=v,\n interpolation='bilinear')", "href": "sources/advanced.triptych/original.html#L30" }, { "line": 39, "end_line": 39, "code": "cbar = fig.colorbar(axes_img[0][1], cax=cbar_ax, orientation='horizontal')", "href": "sources/advanced.triptych/original.html#L39" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.posterior_trace_density", "display_name": "MCMC轨迹与后验密度", "tags": [ "诊断", "分布", "组合" ], "purpose": "各链是否混合,参数后验集中在哪里?", "data_requirements": [ "参数×链×迭代样本", "burn-in设置" ], "composition": "每参数一行;左轨迹、右侧竖向密度,共享参数轴", "visual_features": [ "多条细链", "burn-in竖线", "浅密度填充", "区间统计框" ], "adaptation_notes": "示例R-hat随机模拟;标注HPDI实际用等尾百分位区间;不能直接当作真实收敛诊断。", "number": 44, "kind": "recipe", "legacy_title": "Posterior Trace + Density — 贝叶斯 MCMC 双面板(多链 trace + 边际密度 + Rhat 标注)", "legacy_ref": "advanced #32", "source": { "original_code": "sources/advanced.posterior_trace_density/original.py", "execution_code": "sources/advanced.posterior_trace_density/render.py", "recipe_section": "sources/advanced.posterior_trace_density/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "8cd4f3aecd814032699c34241213c296722340e21a8af0086272305de982cc8f", "code_sha256": "fa7293be5908d2b8b2236992ec4728e4c224633970bd1817e474997e66b169a3", "execution_sha256": "fa7293be5908d2b8b2236992ec4728e4c224633970bd1817e474997e66b169a3", "code_view": "sources/advanced.posterior_trace_density/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.posterior_trace_density-1.png", "thumbnail": "thumbnails/advanced.posterior_trace_density-1.jpg", "sha256": "2cb4f58894050f1d780d409f75d8fa07bc6ee92474c2b3c3228826a3b7385b62", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 32, "operation": "plot", "code": " ax_trace.plot(np.arange(n_iter), chains[p, c], color=PALETTE[c % len(PALETTE)], linewidth=0.5, alpha=0.75, label=f'链 {c+1}' if p == 0 else None)" }, { "line": 53, "operation": "fill_betweenx", "code": " ax_dens.fill_betweenx(yg, 0, density, color=_lighten(PALETTE[0], 0.4), alpha=0.7, linewidth=0)" }, { "line": 55, "operation": "plot", "code": " ax_dens.plot(density, yg, color=PALETTE[0], linewidth=1.5)" } ], "literal_colormaps": [], "aliases": [ "MCMC", "posterior", "trace", "后验诊断" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.posterior_trace_density.md", "fidelity_checkpoints": [ { "feature": "轨迹与竖向密度对齐", "preserve": "保留每参数左侧多链细轨迹、右侧浅密度和深轮廓,共享参数值轴与 burn-in 标记。", "allowed_adaptation": "链数、迭代数、舍弃区间与参数行数可变;后验摘要由保留样本计算,不由轨迹外观臆断收敛。", "evidence": [ { "line": 32, "end_line": 34, "code": " ax_trace.plot(np.arange(n_iter), chains[p, c],\n color=PALETTE[c % len(PALETTE)], linewidth=0.5, alpha=0.75,\n label=f'链 {c+1}' if p == 0 else None)", "href": "sources/advanced.posterior_trace_density/original.html#L32" }, { "line": 35, "end_line": 35, "code": " ax_trace.axvline(burnin, color=COLORS['ref_line'], linestyle=':', linewidth=1, alpha=0.6)", "href": "sources/advanced.posterior_trace_density/original.html#L35" }, { "line": 53, "end_line": 54, "code": " ax_dens.fill_betweenx(yg, 0, density, color=_lighten(PALETTE[0], 0.4),\n alpha=0.7, linewidth=0)", "href": "sources/advanced.posterior_trace_density/original.html#L53" }, { "line": 55, "end_line": 55, "code": " ax_dens.plot(density, yg, color=PALETTE[0], linewidth=1.5)", "href": "sources/advanced.posterior_trace_density/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.streamgraph", "display_name": "居中流带图", "tags": [ "组成", "趋势" ], "purpose": "多个类别随时间如何兴衰与交替?", "data_requirements": [ "时间×类别非负值" ], "composition": "总量居中偏移的堆叠面积;末端标签", "visual_features": [ "流带起伏", "浅填充与细轮廓", "省略纵轴刻度" ], "adaptation_notes": "厚度编码值,垂直位置无实际含义;示例有平滑,正式数据平滑需保留解释。", "number": 45, "kind": "recipe", "legacy_title": "Streamgraph — 流图(居中堆叠基线 + 多类别 + 末端标签)", "legacy_ref": "advanced #33", "source": { "original_code": "sources/advanced.streamgraph/original.py", "execution_code": "sources/advanced.streamgraph/render.py", "recipe_section": "sources/advanced.streamgraph/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "ca7e550b94c108873c1e34164c732020e3dbe613218734481049b8f47dc1c0d6", "code_sha256": "de4d29b4aad150315bfe08a1be1f79cd4d66bfbb6b823b4143743a36be3d7c9e", "execution_sha256": "de4d29b4aad150315bfe08a1be1f79cd4d66bfbb6b823b4143743a36be3d7c9e", "code_view": "sources/advanced.streamgraph/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.streamgraph-1.png", "thumbnail": "thumbnails/advanced.streamgraph-1.jpg", "sha256": "7f2089d9ae90e9b56b0e54a7952d6206ef4227179262ff2f2ec389f758a559e5", "pixels": [ 1620, 810 ], "native_inches": [ 9.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 32, "operation": "fill_between", "code": " ax.fill_between(t, cumsum, cumsum + vals, color=_lighten(color, 0.25), alpha=0.88, edgecolor=color, linewidth=0.5, label=name)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "basic.area", "empirical.variance_decomposition" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.streamgraph.md", "fidelity_checkpoints": [ { "feature": "居中流带与连续轮廓", "preserve": "保留总量居中偏移的流带、浅填充与细轮廓以及末端类别标签,不改成零基线普通面积图。", "allowed_adaptation": "成分数量与序列长度可变;成分可相加,末端很窄时调整标签位置而非删掉流带。", "evidence": [ { "line": 32, "end_line": 34, "code": " ax.fill_between(t, cumsum, cumsum + vals,\n color=_lighten(color, 0.25), alpha=0.88,\n edgecolor=color, linewidth=0.5, label=name)", "href": "sources/advanced.streamgraph/original.html#L32" }, { "line": 37, "end_line": 40, "code": " ax.text(t[-1] + 0.7, end_mid, name, fontsize=8, va='center',\n color=color, fontweight='bold',\n bbox=dict(boxstyle='round,pad=0.18', facecolor='white',\n edgecolor=color, alpha=0.9, linewidth=0.5))", "href": "sources/advanced.streamgraph/original.html#L37" }, { "line": 54, "end_line": 58, "code": "ax.text(0.02, 0.97, '流带厚度 = 该时刻的数值;垂直位置无意义',\n transform=ax.transAxes, fontsize=7, color=COLORS['text'],\n style='italic', va='top',\n bbox=dict(boxstyle='round,pad=0.2', facecolor='white',\n edgecolor=COLORS['grid'], alpha=0.85, linewidth=0.3))", "href": "sources/advanced.streamgraph/original.html#L54" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "advanced.bivariate_choropleth", "display_name": "双变量空间网格与九宫格图例", "tags": [ "空间", "矩阵", "多维" ], "purpose": "两个变量在空间上哪些地方同时高或低?", "data_requirements": [ "同网格的两张数值矩阵" ], "composition": "左空间格网;右3×3双变量图例", "visual_features": [ "两主色混合成九级离散色", "浅底格网" ], "adaptation_notes": "当前实现是规则网格而非行政区地图;原图例B轴高低方向与构造次序需核对;分位等级不表达绝对差距。", "number": 46, "kind": "recipe", "legacy_title": "Bivariate Choropleth / 双变量热图 — 二维联合分布(3×3 配色矩阵 + 主图 + 图例)", "legacy_ref": "advanced #34", "source": { "original_code": "sources/advanced.bivariate_choropleth/original.py", "execution_code": "sources/advanced.bivariate_choropleth/render.py", "recipe_section": "sources/advanced.bivariate_choropleth/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "b68244d3557b44a961f82a56f5b87e73cf2544fb093ba8b6776529eed891f874", "code_sha256": "6ba77d1d03d9d78b67bb321633015f1f0584e6d590d7949f93d9d36941714bce", "execution_sha256": "6ba77d1d03d9d78b67bb321633015f1f0584e6d590d7949f93d9d36941714bce", "code_view": "sources/advanced.bivariate_choropleth/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/advanced.bivariate_choropleth-1.png", "thumbnail": "thumbnails/advanced.bivariate_choropleth-1.jpg", "sha256": "c9ea8ab20acf979b09883e2303b57d9076aed192957cd6a085421849a26d5b10", "pixels": [ 1350, 900 ], "native_inches": [ 7.5, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 40, "operation": "imshow", "code": "ax_main.imshow(rgb, origin='lower', interpolation='nearest')" }, { "line": 53, "operation": "imshow", "code": "ax_leg.imshow(legend_grid, origin='lower', interpolation='nearest')" } ], "literal_colormaps": [], "aliases": [ "bivariate grid", "双变量地图", "九宫格图例" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/advanced.bivariate_choropleth.md", "fidelity_checkpoints": [ { "feature": "双变量九格混色", "preserve": "保留双变量分级混色与对应的 3×3 图例,两个图例方向分别解释一个变量,不换成单变量连续色条。", "allowed_adaptation": "分位阈值、空间格网和混色端点可调整;确保每格类别与图例一致。", "evidence": [ { "line": 40, "end_line": 40, "code": "ax_main.imshow(rgb, origin='lower', interpolation='nearest')", "href": "sources/advanced.bivariate_choropleth/original.html#L40" }, { "line": 53, "end_line": 53, "code": "ax_leg.imshow(legend_grid, origin='lower', interpolation='nearest')", "href": "sources/advanced.bivariate_choropleth/original.html#L53" }, { "line": 66, "end_line": 67, "code": " ax_leg.text(j, 2-i, f'A{j+1}B{i+1}', ha='center', va='center',\n fontsize=7, color=COLORS['text'], fontweight='bold')", "href": "sources/advanced.bivariate_choropleth/original.html#L66" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.forest", "display_name": "效应森林图与权重摘要", "tags": [ "误差", "比较", "组合" ], "purpose": "多项效应的方向、精度和汇总结果如何?", "data_requirements": [ "效应估计、CI上下界、权重、标签", "可选显著性" ], "composition": "逐行点区间;两侧文字列;汇总菱形", "visual_features": [ "交替行浅底", "实心空心点", "零线", "菱形摘要" ], "adaptation_notes": "原示例某行CI上下界倒置,且显著性布尔值独立指定;需使用真实一致的估计结果。", "number": 47, "kind": "recipe", "legacy_title": "Forest Plot (Stata/SCI style)", "legacy_ref": "empirical #1", "source": { "original_code": "sources/empirical.forest/original.py", "execution_code": "sources/empirical.forest/render.py", "recipe_section": "sources/empirical.forest/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "06b3f2ab0592576c6f7a31d8c6ecbde45d1fcf2c38e8a101be9dbf36828d4f2e", "code_sha256": "e17ab634542e965eb1a2972ef38f678f3fcdb1592e8d7d5b281a5c31ca568732", "execution_sha256": "e17ab634542e965eb1a2972ef38f678f3fcdb1592e8d7d5b281a5c31ca568732", "code_view": "sources/empirical.forest/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.forest-1.png", "thumbnail": "thumbnails/empirical.forest-1.jpg", "sha256": "5d9906f0c1d111d786bd1518dcfe514c220b4fe4d63b0b127482e269a2a616de", "pixels": [ 1980, 1368 ], "native_inches": [ 11.0, 7.6 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 33, "operation": "plot", "code": " ax.plot([lo, hi], [y[i], y[i]], color=COLORS['text'], linewidth=1.2, zorder=2, solid_capstyle='round')" }, { "line": 34, "operation": "plot", "code": " ax.plot([lo, lo], [y[i]-0.12, y[i]+0.12], color=COLORS['text'], linewidth=1.0)" }, { "line": 35, "operation": "plot", "code": " ax.plot([hi, hi], [y[i]-0.12, y[i]+0.12], color=COLORS['text'], linewidth=1.0)" }, { "line": 41, "operation": "plot", "code": " ax.plot(c, y[i], 'o', color=fc, markersize=ms, markeredgecolor=ec, markeredgewidth=1.3, zorder=3)" }, { "line": 71, "operation": "fill", "code": "ax.fill(diamond_x, diamond_yy, color=PALETTE[1], alpha=0.85, zorder=4)" }, { "line": 72, "operation": "plot", "code": "ax.plot(diamond_x + [diamond_x[0]], diamond_yy + [diamond_yy[0]], color=COLORS['text'], linewidth=0.8, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "forest plot", "效应区间", "meta" ], "related_ids": [ "empirical.subgroup_forest", "advanced.dot_ci" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.forest.md", "fidelity_checkpoints": [ { "feature": "点区间和汇总菱形", "preserve": "保留浅交替行、带端帽的区间、空实心点、零线与汇总菱形,两侧文本按行对齐。", "allowed_adaptation": "效应方向、研究数、权重与区间据实更新;空实心编码及汇总方法必须与说明一致。", "evidence": [ { "line": 26, "end_line": 26, "code": " ax.axhspan(y[i] - 0.55, y[i] + 0.55, color=COLORS['bg_box'], zorder=0)", "href": "sources/empirical.forest/original.html#L26" }, { "line": 33, "end_line": 33, "code": " ax.plot([lo, hi], [y[i], y[i]], color=COLORS['text'], linewidth=1.2, zorder=2, solid_capstyle='round')", "href": "sources/empirical.forest/original.html#L33" }, { "line": 34, "end_line": 34, "code": " ax.plot([lo, lo], [y[i]-0.12, y[i]+0.12], color=COLORS['text'], linewidth=1.0)", "href": "sources/empirical.forest/original.html#L34" }, { "line": 35, "end_line": 35, "code": " ax.plot([hi, hi], [y[i]-0.12, y[i]+0.12], color=COLORS['text'], linewidth=1.0)", "href": "sources/empirical.forest/original.html#L35" }, { "line": 41, "end_line": 42, "code": " ax.plot(c, y[i], 'o', color=fc, markersize=ms, markeredgecolor=ec,\n markeredgewidth=1.3, zorder=3)", "href": "sources/empirical.forest/original.html#L41" }, { "line": 45, "end_line": 45, "code": " ax.text(-0.065, y[i], lbl, ha='right', va='center', fontsize=9, color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L45" }, { "line": 49, "end_line": 52, "code": " ax.text(0.085, y[i], f'{c:.3f} [{lo:.3f}, {hi:.3f}]{sig_mark}',\n ha='left', va='center', fontsize=8, fontfamily='monospace',\n color=PALETTE[0] if sig else COLORS['ref_line'],\n fontweight='bold' if sig else 'normal')", "href": "sources/empirical.forest/original.html#L49" }, { "line": 55, "end_line": 56, "code": " ax.text(0.16, y[i], f'{wt:.1f}%', ha='right', va='center',\n fontsize=8, color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L55" }, { "line": 59, "end_line": 60, "code": "ax.text(-0.065, max(y) + 1.0, '分组', ha='right', va='center',\n fontsize=9.5, fontweight='bold', color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L59" }, { "line": 61, "end_line": 62, "code": "ax.text(0.085, max(y) + 1.0, '系数 [95% CI]', ha='left', va='center',\n fontsize=9.5, fontweight='bold', color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L61" }, { "line": 63, "end_line": 64, "code": "ax.text(0.16, max(y) + 1.0, '权重', ha='right', va='center',\n fontsize=9.5, fontweight='bold', color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L63" }, { "line": 71, "end_line": 71, "code": "ax.fill(diamond_x, diamond_yy, color=PALETTE[1], alpha=0.85, zorder=4)", "href": "sources/empirical.forest/original.html#L71" }, { "line": 72, "end_line": 73, "code": "ax.plot(diamond_x + [diamond_x[0]], diamond_yy + [diamond_yy[0]],\n color=COLORS['text'], linewidth=0.8, zorder=5)", "href": "sources/empirical.forest/original.html#L72" }, { "line": 74, "end_line": 75, "code": "ax.text(-0.065, diamond_y, 'Pooled', ha='right', va='center',\n fontsize=9.5, fontweight='bold', color=PALETTE[1])", "href": "sources/empirical.forest/original.html#L74" }, { "line": 76, "end_line": 78, "code": "ax.text(0.085, diamond_y, f'{pooled_coef:.3f} [{pooled_lo:.3f}, {pooled_hi:.3f}]***',\n ha='left', va='center', fontsize=8, fontfamily='monospace',\n fontweight='bold', color=PALETTE[1])", "href": "sources/empirical.forest/original.html#L76" }, { "line": 82, "end_line": 85, "code": "ax.text(0.0, diamond_y - 1.0, i2_text, ha='center', va='top', fontsize=8.5,\n bbox=dict(boxstyle='round,pad=0.4', facecolor=_lighten(COLORS['highlight'], 0.85),\n edgecolor=_lighten(COLORS['highlight'], 0.4), alpha=0.95),\n color=COLORS['text'])", "href": "sources/empirical.forest/original.html#L82" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.parallel_trends", "display_name": "处理组与对照组趋势", "tags": [ "因果", "趋势", "误差" ], "purpose": "干预前后两组路径是否分离?", "data_requirements": [ "相对时期", "两组均值或估计轨迹及标准误" ], "composition": "双序列;干预前后背景区", "visual_features": [ "八层透明区间", "实虚线区分", "干预分界与末端差值箭头" ], "adaptation_notes": "末端差值注释ATT并非正式DID估计;视觉近似平行不替代识别假设检验。", "number": 48, "kind": "recipe", "legacy_title": "Parallel Trends (DID)", "legacy_ref": "empirical #2", "source": { "original_code": "sources/empirical.parallel_trends/original.py", "execution_code": "sources/empirical.parallel_trends/render.py", "recipe_section": "sources/empirical.parallel_trends/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "3671d8d04481400d5bec99904664d3284fcc567e892a2f228ea4bb01341fb52e", "code_sha256": "94623d317f23264068e7d1b63abfe4d76635d1dc1cc74cb8bf7fd16778f90d1b", "execution_sha256": "94623d317f23264068e7d1b63abfe4d76635d1dc1cc74cb8bf7fd16778f90d1b", "code_view": "sources/empirical.parallel_trends/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.parallel_trends-1.png", "thumbnail": "thumbnails/empirical.parallel_trends-1.jpg", "sha256": "9c5181f35a629612a76327310d765f93f857963f8520be7b0ba2cb78959c18f6", "pixels": [ 1620, 990 ], "native_inches": [ 9.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 30, "operation": "fill_between", "code": " ax.fill_between(periods, treat - frac*1.96*se_t, treat + frac*1.96*se_t, alpha=0.04, color=PALETTE[0], linewidth=0)" }, { "line": 32, "operation": "fill_between", "code": " ax.fill_between(periods, ctrl - frac*1.96*se_c, ctrl + frac*1.96*se_c, alpha=0.04, color=PALETTE[1], linewidth=0)" }, { "line": 35, "operation": "plot", "code": "ax.plot(periods, treat, 'o-', color=PALETTE[0], markersize=7, linewidth=2.2, label='Treatment', markeredgecolor='white', markeredgewidth=1, zorder=5)" }, { "line": 37, "operation": "plot", "code": "ax.plot(periods, ctrl, 's--', color=PALETTE[1], markersize=6, linewidth=1.8, label='Control', markeredgecolor='white', markeredgewidth=1, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "DID", "parallel trends", "平行趋势" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.parallel_trends.md", "fidelity_checkpoints": [ { "feature": "多层区间与干预分区", "preserve": "保留八层透明区间、处理/对照实虚线与白边点、干预前后分区和末端差值箭头。", "allowed_adaptation": "时期、干预时点、均值与标准误重新计算,区间内缩保持嵌套,不凭图宣称平行趋势成立。", "evidence": [ { "line": 15, "end_line": 15, "code": " ax.axvspan(x_start, x_end, color=c_base, alpha=0.25, zorder=0)", "href": "sources/empirical.parallel_trends/original.html#L15" }, { "line": 30, "end_line": 31, "code": " ax.fill_between(periods, treat - frac*1.96*se_t, treat + frac*1.96*se_t,\n alpha=0.04, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.parallel_trends/original.html#L30" }, { "line": 32, "end_line": 33, "code": " ax.fill_between(periods, ctrl - frac*1.96*se_c, ctrl + frac*1.96*se_c,\n alpha=0.04, color=PALETTE[1], linewidth=0)", "href": "sources/empirical.parallel_trends/original.html#L32" }, { "line": 35, "end_line": 36, "code": "ax.plot(periods, treat, 'o-', color=PALETTE[0], markersize=7, linewidth=2.2,\n label='Treatment', markeredgecolor='white', markeredgewidth=1, zorder=5)", "href": "sources/empirical.parallel_trends/original.html#L35" }, { "line": 37, "end_line": 38, "code": "ax.plot(periods, ctrl, 's--', color=PALETTE[1], markersize=6, linewidth=1.8,\n label='Control', markeredgecolor='white', markeredgewidth=1, zorder=5)", "href": "sources/empirical.parallel_trends/original.html#L37" }, { "line": 40, "end_line": 47, "code": "ax.annotate(f'ATT = {treat[-1]-ctrl[-1]:.2f}',\n xy=(periods[-1], treat[-1]),\n xytext=(periods[-1] - 1.5, treat[-1] + 0.12),\n fontsize=9, fontweight='bold', color=PALETTE[0],\n arrowprops=dict(arrowstyle='->', color=PALETTE[0], lw=1.5,\n connectionstyle='arc3,rad=-0.2'),\n bbox=dict(boxstyle='round,pad=0.3', facecolor='white',\n edgecolor=PALETTE[0], alpha=0.9))", "href": "sources/empirical.parallel_trends/original.html#L40" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.event_study", "display_name": "事件时间系数与累计效应", "tags": [ "因果", "趋势", "误差" ], "purpose": "干预动态效应出现于何时并持续多久?", "data_requirements": [ "事件期系数和标准误", "基准期约定" ], "composition": "主轴点区间;副轴干预后累计系数", "visual_features": [ "前后分区", "灰色干预前点", "彩色后期点", "显著性星号" ], "adaptation_notes": "不包含回归估计;基准期及累计效应定义需匹配模型;副轴累计线没有自动联合CI。", "number": 49, "kind": "recipe", "legacy_title": "Event Study", "legacy_ref": "empirical #3", "source": { "original_code": "sources/empirical.event_study/original.py", "execution_code": "sources/empirical.event_study/render.py", "recipe_section": "sources/empirical.event_study/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "a09008c86e9bbb1e14fb644d4a3c45fa3b03b33219349363f9179d3e6f16a4c1", "code_sha256": "0a6919fb3d0c84d9b31f571e0815b0ca88b116e44dc2e4c334967ebf9981648f", "execution_sha256": "0a6919fb3d0c84d9b31f571e0815b0ca88b116e44dc2e4c334967ebf9981648f", "code_view": "sources/empirical.event_study/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.event_study-1.png", "thumbnail": "thumbnails/empirical.event_study-1.jpg", "sha256": "58c037ff820beeaadcea43e59b31df40375f61d8d71615dbf302edebc983da6f", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "plot", "code": " ax.plot([t_val, t_val], [c - frac*1.96*s, c + frac*1.96*s], color=base_color, linewidth=3.5 - k*0.3, alpha=0.08 + 0.04*(n_layers-k) + 0.3, solid_capstyle='round')" }, { "line": 24, "operation": "plot", "code": " ax.plot([t_val, t_val], [lo, hi], color=base_color, linewidth=2.5, solid_capstyle='round', alpha=0.8)" }, { "line": 26, "operation": "plot", "code": " ax.plot(t_val, c, 'o', color=base_color, markersize=8, markeredgecolor='white', markeredgewidth=1.2, zorder=5)" }, { "line": 36, "operation": "plot", "code": "ax2.plot(periods[post_mask], cum_effect, '--', color=PALETTE[1], linewidth=1.5, alpha=0.7, label='Cumulative Effect')" } ], "literal_colormaps": [], "aliases": [ "event study", "动态DID", "事件研究" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.event_study.md", "fidelity_checkpoints": [ { "feature": "前后点区间与累计效应", "preserve": "保留干预前后配色差异、分层区间线及中心点、零参考与副轴累计路径。", "allowed_adaptation": "基期、系数、区间与累计统计按模型替换,不把缺少基期估计当零误差点。", "evidence": [ { "line": 10, "end_line": 10, "code": "ax.axhline(y=0, color=COLORS['ref_line'], linewidth=0.6, alpha=0.5)", "href": "sources/empirical.event_study/original.html#L10" }, { "line": 12, "end_line": 12, "code": "ax.axvspan(-4.5, -0.5, color=COLORS['bg_box'], alpha=0.3, zorder=0)", "href": "sources/empirical.event_study/original.html#L12" }, { "line": 13, "end_line": 13, "code": "ax.axvspan(-0.5, 4.5, color=_lighten(COLORS['highlight'], 0.85), alpha=0.3, zorder=0)", "href": "sources/empirical.event_study/original.html#L13" }, { "line": 21, "end_line": 23, "code": " ax.plot([t_val, t_val], [c - frac*1.96*s, c + frac*1.96*s],\n color=base_color, linewidth=3.5 - k*0.3, alpha=0.08 + 0.04*(n_layers-k) + 0.3,\n solid_capstyle='round')", "href": "sources/empirical.event_study/original.html#L21" }, { "line": 24, "end_line": 25, "code": " ax.plot([t_val, t_val], [lo, hi], color=base_color, linewidth=2.5,\n solid_capstyle='round', alpha=0.8)", "href": "sources/empirical.event_study/original.html#L24" }, { "line": 26, "end_line": 27, "code": " ax.plot(t_val, c, 'o', color=base_color, markersize=8,\n markeredgecolor='white', markeredgewidth=1.2, zorder=5)", "href": "sources/empirical.event_study/original.html#L26" }, { "line": 36, "end_line": 37, "code": "ax2.plot(periods[post_mask], cum_effect, '--', color=PALETTE[1], linewidth=1.5,\n alpha=0.7, label='Cumulative Effect')", "href": "sources/empirical.event_study/original.html#L36" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.placebo", "display_name": "安慰剂系数分布与真实效应", "tags": [ "因果", "分布", "诊断" ], "purpose": "真实估计相对随机置换结果是否异常?", "data_requirements": [ "置换或安慰剂估计样本", "真实估计值" ], "composition": "直方图叠加KDE;真实值竖线", "visual_features": [ "多层透明密度填充", "分位参考线", "尾部箭头" ], "adaptation_notes": "示例仅模拟正态系数,未执行置换回归;p值应按实际置换方案和有限次数口径计算。", "number": 50, "kind": "recipe", "legacy_title": "Placebo Test", "legacy_ref": "empirical #4", "source": { "original_code": "sources/empirical.placebo/original.py", "execution_code": "sources/empirical.placebo/render.py", "recipe_section": "sources/empirical.placebo/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "3079caea6a2c1afd2ff75b9e9059b65b18b61a6471d9ab8d1aa40a7bd4dac825", "code_sha256": "43d457f59023d4bf4ff06989f10a74dd06a9e6d233be5ff9e1a5fc2e310e81ad", "execution_sha256": "43d457f59023d4bf4ff06989f10a74dd06a9e6d233be5ff9e1a5fc2e310e81ad", "code_view": "sources/empirical.placebo/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.placebo-1.png", "thumbnail": "thumbnails/empirical.placebo-1.jpg", "sha256": "0635c237b93e6cead758eabefab121cd714cf8f702cc3707f37301c84f1b28bb", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 16, "operation": "fill_between", "code": " ax.fill_between(xk, 0, yk * (1 - k*0.02), alpha=0.03, color=PALETTE[0], linewidth=0)" }, { "line": 17, "operation": "fill_between", "code": "ax.fill_between(xk, 0, yk, alpha=0.15, color=PALETTE[0], linewidth=0)" }, { "line": 18, "operation": "plot", "code": "ax.plot(xk, yk, color=PALETTE[0], linewidth=2.5, zorder=4)" }, { "line": 19, "operation": "hist", "code": "ax.hist(fake, bins=45, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8, zorder=2)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.placebo.md", "fidelity_checkpoints": [ { "feature": "透明密度叠层与真实值", "preserve": "保留随机化分布的直方/KDE、分层透明填充、分位参考和真实估计竖线。", "allowed_adaptation": "重复次数、带宽、真实估计及尾部概率据实计算,避免用模拟尾部位置暗示显著性。", "evidence": [ { "line": 16, "end_line": 16, "code": " ax.fill_between(xk, 0, yk * (1 - k*0.02), alpha=0.03, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.placebo/original.html#L16" }, { "line": 17, "end_line": 17, "code": "ax.fill_between(xk, 0, yk, alpha=0.15, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.placebo/original.html#L17" }, { "line": 18, "end_line": 18, "code": "ax.plot(xk, yk, color=PALETTE[0], linewidth=2.5, zorder=4)", "href": "sources/empirical.placebo/original.html#L18" }, { "line": 19, "end_line": 19, "code": "ax.hist(fake, bins=45, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8, zorder=2)", "href": "sources/empirical.placebo/original.html#L19" }, { "line": 22, "end_line": 22, "code": " ax.axvline(x=pval_pct, color=COLORS['ref_line'], linestyle=':', linewidth=1.0, alpha=0.7)", "href": "sources/empirical.placebo/original.html#L22" }, { "line": 26, "end_line": 26, "code": "ax.axvline(x=real, color=PALETTE[1], linewidth=2.5, zorder=5)", "href": "sources/empirical.placebo/original.html#L26" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.correlation_heatmap", "display_name": "相关显著性热图与顶部树", "tags": [ "关联", "矩阵", "聚类" ], "purpose": "变量相关方向、强度及显著性如何?", "data_requirements": [ "原始变量样本", "或相关矩阵与对应p值" ], "composition": "下三角矩阵;顶部树;侧色条", "visual_features": [ "红蓝色阶", "相关数值与星号", "白格线" ], "adaptation_notes": "当前树的顺序没有同步重排矩阵;聚类输入定义需核对;显著性来自样本而非相关数值本身。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 51, "kind": "recipe", "legacy_title": "Correlation Heatmap", "legacy_ref": "empirical #5", "source": { "original_code": "sources/empirical.correlation_heatmap/original.py", "execution_code": "sources/empirical.correlation_heatmap/render.py", "recipe_section": "sources/empirical.correlation_heatmap/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "18746276a4ddf1f0bf367861e62fd0ed9068a07a3afee7704d4be7f0b6f6028f", "code_sha256": "0e918c95694b8f53df34c55e510e4f7682fbcb560e2162de2b0e800cfbe6207b", "execution_sha256": "0e918c95694b8f53df34c55e510e4f7682fbcb560e2162de2b0e800cfbe6207b", "code_view": "sources/empirical.correlation_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.correlation_heatmap-1.png", "thumbnail": "thumbnails/empirical.correlation_heatmap-1.jpg", "sha256": "f1d45483e4620b55c73ca50aede64d584a7edd907224fb72ba704982aeb3fd74", "pixels": [ 1768, 1630 ], "native_inches": [ 10.0, 9.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 25, "operation": "dendrogram", "code": "dendrogram(Z, labels=labels, ax=ax_dendro, leaf_rotation=0, color_threshold=0, above_threshold_color=COLORS['ref_line'])" }, { "line": 31, "operation": "heatmap", "code": "sns.heatmap(corr, mask=mask, annot=False, cmap=palette_cmap('diverging'), center=0, square=True," } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.pair_plot", "template.sem_violin_pearson", "competition.correlation_matrix", "basic.heatmap" ], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.correlation_heatmap.md", "fidelity_checkpoints": [ { "feature": "聚类下三角与统计标签", "preserve": "保留聚类顺序、下三角遮罩、相关数值/星号、白格线和发散色阶;自绘注释不能因 annot=False 被漏掉。", "allowed_adaptation": "变量、顺序、色相和精度可变;星号需有有效检验,不从相关大小直接生成。", "evidence": [ { "line": 25, "end_line": 25, "code": "dendrogram(Z, labels=labels, ax=ax_dendro, leaf_rotation=0, color_threshold=0, above_threshold_color=COLORS['ref_line'])", "href": "sources/empirical.correlation_heatmap/original.html#L25" }, { "line": 31, "end_line": 33, "code": "sns.heatmap(corr, mask=mask, annot=False, cmap=palette_cmap('diverging'), center=0, square=True,\n linewidths=1.0, linecolor='white', xticklabels=labels, yticklabels=labels,\n cbar_kws={'shrink': 0.7, 'label': 'Correlation'}, ax=ax_heat, vmin=-1, vmax=1)", "href": "sources/empirical.correlation_heatmap/original.html#L31" }, { "line": 42, "end_line": 43, "code": " ax_heat.text(j + 0.5, i + 0.5, f'{val:.2f}{stars}', ha='center', va='center',\n fontsize=8.5, color=txt_color, fontweight='bold' if i == j else 'normal')", "href": "sources/empirical.correlation_heatmap/original.html#L42" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.raincloud", "display_name": "横向长尾分布雨云与分位标记", "tags": [ "分布", "比较", "组合" ], "purpose": "偏态分布的尾部、中心和组间差异怎样?", "data_requirements": [ "各组原始连续样本" ], "composition": "横向半密度+箱线+下方散点;分位数标记", "visual_features": [ "十五层透明密度", "深轮廓", "正态性统计框" ], "adaptation_notes": "预览长尾压缩主体;KDE只到99分位但点仍可更远;正态性检验示例只取前50样本。", "number": 52, "kind": "recipe", "legacy_title": "Distribution (Rain Cloud with Gradient KDE)", "legacy_ref": "empirical #6", "source": { "original_code": "sources/empirical.raincloud/original.py", "execution_code": "sources/empirical.raincloud/render.py", "recipe_section": "sources/empirical.raincloud/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "38b3ddbb2c5e8d07b301b50ce6caa566ed7d801a1c8d28946858c2dd0331aa3a", "code_sha256": "9af4183b50baf84495c7ddbd8fd0ddbf135751eaec993a95e1e02b4195ea7532", "execution_sha256": "9af4183b50baf84495c7ddbd8fd0ddbf135751eaec993a95e1e02b4195ea7532", "code_view": "sources/empirical.raincloud/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.raincloud-1.png", "thumbnail": "thumbnails/empirical.raincloud-1.jpg", "sha256": "dfeeb34f1318f376e5fb2d6911ac8be661628c2b08db0a5bd9dab2ec8f510a4e", "pixels": [ 1800, 990 ], "native_inches": [ 10.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 24, "operation": "fill_between", "code": " ax.fill_between(x_kde, y_center, y_center + y_kde_norm*frac, alpha=0.035, color=PALETTE[i], linewidth=0)" }, { "line": 26, "operation": "fill_between", "code": " ax.fill_between(x_kde, y_center, y_center + y_kde_norm, alpha=0.2, color=PALETTE[i], linewidth=0)" }, { "line": 27, "operation": "plot", "code": " ax.plot(x_kde, y_center + y_kde_norm, color=PALETTE[i], linewidth=1.5)" }, { "line": 29, "operation": "boxplot", "code": " ax.boxplot([data], positions=[y_center], vert=False, widths=0.3, patch_artist=True, boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2), medianprops=dict(color=COLORS['text'], linewidth=1.5), whiskerprops=dict(color=PALETTE[i], linewidth=1)," }, { "line": 37, "operation": "scatter", "code": " ax.scatter(data[::3], y_center + jitter[:len(data[::3])], s=4, alpha=0.25, color=PALETTE[i], zorder=2)" }, { "line": 41, "operation": "plot", "code": " ax.plot(pv, y_center - 0.7, '|', color=PALETTE[i], markersize=8, markeredgewidth=1.5, zorder=4)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "basic.raincloud", "basic.raincloud_violin", "advanced.grouped_violin", "advanced.ridgeline", "academic.confusion_matrix", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.raincloud.md", "fidelity_checkpoints": [ { "feature": "横向多层云与下方样本", "preserve": "保留十五层云填充加底层、深轮廓、下方箱线/散点及分位标记,横向值轴一致。", "allowed_adaptation": "样本量、组数、云高、带宽和标签可变;分位、均值和正态性结果据实计算。", "evidence": [ { "line": 24, "end_line": 25, "code": " ax.fill_between(x_kde, y_center, y_center + y_kde_norm*frac,\n alpha=0.035, color=PALETTE[i], linewidth=0)", "href": "sources/empirical.raincloud/original.html#L24" }, { "line": 26, "end_line": 26, "code": " ax.fill_between(x_kde, y_center, y_center + y_kde_norm, alpha=0.2, color=PALETTE[i], linewidth=0)", "href": "sources/empirical.raincloud/original.html#L26" }, { "line": 27, "end_line": 27, "code": " ax.plot(x_kde, y_center + y_kde_norm, color=PALETTE[i], linewidth=1.5)", "href": "sources/empirical.raincloud/original.html#L27" }, { "line": 29, "end_line": 34, "code": " ax.boxplot([data], positions=[y_center], vert=False, widths=0.3, patch_artist=True,\n boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2),\n medianprops=dict(color=COLORS['text'], linewidth=1.5),\n whiskerprops=dict(color=PALETTE[i], linewidth=1),\n capprops=dict(color=PALETTE[i], linewidth=1),\n flierprops=dict(marker='.', markersize=2, alpha=0.3, markerfacecolor=PALETTE[i]))", "href": "sources/empirical.raincloud/original.html#L29" }, { "line": 37, "end_line": 37, "code": " ax.scatter(data[::3], y_center + jitter[:len(data[::3])], s=4, alpha=0.25, color=PALETTE[i], zorder=2)", "href": "sources/empirical.raincloud/original.html#L37" }, { "line": 41, "end_line": 41, "code": " ax.plot(pv, y_center - 0.7, '|', color=PALETTE[i], markersize=8, markeredgewidth=1.5, zorder=4)", "href": "sources/empirical.raincloud/original.html#L41" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.time_series", "display_name": "双指标时序与事件背景", "tags": [ "趋势", "时间", "组合" ], "purpose": "不同单位指标如何共同演化,事件发生在哪里?", "data_requirements": [ "同一时间索引下两组数值", "事件时间" ], "composition": "双纵轴折线;曲线下方填充", "visual_features": [ "多层渐淡填充", "不同点形", "事件竖线", "相关系数框" ], "adaptation_notes": "双轴尺度影响观感;共同趋势会影响相关解释;事件标注不表示因果识别。", "number": 53, "kind": "recipe", "legacy_title": "Time Series Trend (Dual Y-axis)", "legacy_ref": "empirical #7", "source": { "original_code": "sources/empirical.time_series/original.py", "execution_code": "sources/empirical.time_series/render.py", "recipe_section": "sources/empirical.time_series/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "9e32ec49431893a55ff0f7975ea501fc8b0ba78c04b5196b7fab65a52afebe15", "code_sha256": "70bef6939888bfd3f8e1997dfab6e5bf07fd330e9c00dcfc0f1b813ffb80ea7d", "execution_sha256": "70bef6939888bfd3f8e1997dfab6e5bf07fd330e9c00dcfc0f1b813ffb80ea7d", "code_view": "sources/empirical.time_series/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.time_series-1.png", "thumbnail": "thumbnails/empirical.time_series-1.jpg", "sha256": "61b58d1443573f1c031245960643dc46673abf72bf1949cfd21cbccdfb2ca452", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 15, "operation": "fill_between", "code": " ax1.fill_between(years, gdp.min()-0.5, gdp-(gdp-gdp.min()+0.5)*(1-frac), alpha=0.02, color=PALETTE[0], linewidth=0)" }, { "line": 17, "operation": "fill_between", "code": "ax1.fill_between(years, gdp.min()-0.5, gdp, alpha=0.08, color=PALETTE[0], linewidth=0)" }, { "line": 21, "operation": "fill_between", "code": " ax2.fill_between(years, digital.min()-0.5, digital-(digital-digital.min()+0.5)*(1-frac), alpha=0.02, color=PALETTE[1], linewidth=0)" }, { "line": 23, "operation": "fill_between", "code": "ax2.fill_between(years, digital.min()-0.5, digital, alpha=0.08, color=PALETTE[1], linewidth=0)" }, { "line": 25, "operation": "plot", "code": "ax1.plot(years, gdp, 'o-', color=PALETTE[0], linewidth=2.2, markersize=6, label='GDP', markeredgecolor='white', markeredgewidth=1, zorder=5)" }, { "line": 27, "operation": "plot", "code": "ax2.plot(years, digital, 's-', color=PALETTE[1], linewidth=2.2, markersize=6, label='Digital Index', markeredgecolor='white', markeredgewidth=1, zorder=5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.time_series.md", "fidelity_checkpoints": [ { "feature": "双轴曲线下的渐淡层", "preserve": "保留两轴各自多层渐淡填充、白边不同点形及事件线;不用不透明纯色覆盖层次。", "allowed_adaptation": "数值范围和填充基线随量纲改变,时期、事件和相关摘要来自当前数据。", "evidence": [ { "line": 15, "end_line": 16, "code": " ax1.fill_between(years, gdp.min()-0.5, gdp-(gdp-gdp.min()+0.5)*(1-frac),\n alpha=0.02, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.time_series/original.html#L15" }, { "line": 17, "end_line": 17, "code": "ax1.fill_between(years, gdp.min()-0.5, gdp, alpha=0.08, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.time_series/original.html#L17" }, { "line": 21, "end_line": 22, "code": " ax2.fill_between(years, digital.min()-0.5, digital-(digital-digital.min()+0.5)*(1-frac),\n alpha=0.02, color=PALETTE[1], linewidth=0)", "href": "sources/empirical.time_series/original.html#L21" }, { "line": 23, "end_line": 23, "code": "ax2.fill_between(years, digital.min()-0.5, digital, alpha=0.08, color=PALETTE[1], linewidth=0)", "href": "sources/empirical.time_series/original.html#L23" }, { "line": 25, "end_line": 26, "code": "ax1.plot(years, gdp, 'o-', color=PALETTE[0], linewidth=2.2, markersize=6,\n label='GDP', markeredgecolor='white', markeredgewidth=1, zorder=5)", "href": "sources/empirical.time_series/original.html#L25" }, { "line": 27, "end_line": 28, "code": "ax2.plot(years, digital, 's-', color=PALETTE[1], linewidth=2.2, markersize=6,\n label='Digital Index', markeredgecolor='white', markeredgewidth=1, zorder=5)", "href": "sources/empirical.time_series/original.html#L27" }, { "line": 31, "end_line": 31, "code": " ax1.axvline(x=yr, color=COLORS['down'], linestyle=':', linewidth=1.0, alpha=0.6)", "href": "sources/empirical.time_series/original.html#L31" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.residual_diagnostics", "display_name": "回归残差四面板与影响点", "tags": [ "诊断", "误差", "组合" ], "purpose": "残差形状、正态性与影响点是否异常?", "data_requirements": [ "拟合值、残差、Cook距离", "对应检验统计" ], "composition": "2×2:残差拟合、Q-Q、分布、Cook距离", "visual_features": [ "透明点", "趋势平滑", "密度填充", "影响点阈值" ], "adaptation_notes": "示例Breusch–Pagan文字固定、Cook距离模拟;区别于右下画ACF的竞赛版四面板。", "number": 54, "kind": "recipe", "legacy_title": "Residual Diagnostics (4-panel)", "legacy_ref": "empirical #8", "source": { "original_code": "sources/empirical.residual_diagnostics/original.py", "execution_code": "sources/empirical.residual_diagnostics/render.py", "recipe_section": "sources/empirical.residual_diagnostics/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "f04c0dcd7250c2087b65aa6be20b5ddbc331d50a24d947112ed633f78fc1c92b", "code_sha256": "a9ee73493673b35c19c762622b7b13bc2f29823bdd68ed1d411d7d4ba342c168", "execution_sha256": "a9ee73493673b35c19c762622b7b13bc2f29823bdd68ed1d411d7d4ba342c168", "code_view": "sources/empirical.residual_diagnostics/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.residual_diagnostics-1.png", "thumbnail": "thumbnails/empirical.residual_diagnostics-1.jpg", "sha256": "6f95396383e7f4c530d31ea3106a1731f74a74e59f0b865166fcae17a78cacbb", "pixels": [ 900, 882 ], "native_inches": [ 5.0, 4.9 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 12, "operation": "scatter", "code": "ax.scatter(fitted, resid, alpha=0.45, s=18, color=PALETTE[0], edgecolor='white', linewidth=0.3, zorder=3)" }, { "line": 16, "operation": "plot", "code": "ax.plot(x_smooth, p(x_smooth), color=PALETTE[1], linewidth=2, zorder=4)" }, { "line": 26, "operation": "scatter", "code": "ax.scatter(osm[0], osm[1], alpha=0.5, s=15, color=PALETTE[0], edgecolor='white', linewidth=0.3)" }, { "line": 29, "operation": "plot", "code": "ax.plot(x_line, slope*x_line+intercept, color=COLORS['down'], linewidth=1.2, linestyle='--')" }, { "line": 39, "operation": "hist", "code": "ax.hist(resid, bins=30, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8)" }, { "line": 42, "operation": "plot", "code": "ax.plot(x_norm, y_norm, color=COLORS['down'], linewidth=2, zorder=4)" }, { "line": 44, "operation": "fill_between", "code": " ax.fill_between(x_norm, 0, y_norm*(k/10), alpha=0.015, color=COLORS['down'], linewidth=0)" }, { "line": 52, "operation": "stem", "code": "ml, sl, bl = ax.stem(range(n), cooks, linefmt='-', markerfmt=',', basefmt='')" }, { "line": 55, "operation": "scatter", "code": "ax.scatter(np.where(influential)[0], cooks[influential], color=COLORS['down'], s=25, zorder=5, edgecolor='white')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "competition.residual_diagnostics" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.residual_diagnostics.md", "fidelity_checkpoints": [ { "feature": "四诊断面板各保留信息层", "preserve": "保留残差—拟合、Q-Q、分布与 Cook 距离四部分,浅点、趋势线、密度层与影响阈值分工明确。", "allowed_adaptation": "残差、拟合、模型自由度及影响指标重算,面板比例可调,不能拿随机诊断值适配正式数据。", "evidence": [ { "line": 12, "end_line": 12, "code": "ax.scatter(fitted, resid, alpha=0.45, s=18, color=PALETTE[0], edgecolor='white', linewidth=0.3, zorder=3)", "href": "sources/empirical.residual_diagnostics/original.html#L12" }, { "line": 16, "end_line": 16, "code": "ax.plot(x_smooth, p(x_smooth), color=PALETTE[1], linewidth=2, zorder=4)", "href": "sources/empirical.residual_diagnostics/original.html#L16" }, { "line": 26, "end_line": 26, "code": "ax.scatter(osm[0], osm[1], alpha=0.5, s=15, color=PALETTE[0], edgecolor='white', linewidth=0.3)", "href": "sources/empirical.residual_diagnostics/original.html#L26" }, { "line": 29, "end_line": 29, "code": "ax.plot(x_line, slope*x_line+intercept, color=COLORS['down'], linewidth=1.2, linestyle='--')", "href": "sources/empirical.residual_diagnostics/original.html#L29" }, { "line": 39, "end_line": 39, "code": "ax.hist(resid, bins=30, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8)", "href": "sources/empirical.residual_diagnostics/original.html#L39" }, { "line": 42, "end_line": 42, "code": "ax.plot(x_norm, y_norm, color=COLORS['down'], linewidth=2, zorder=4)", "href": "sources/empirical.residual_diagnostics/original.html#L42" }, { "line": 44, "end_line": 44, "code": " ax.fill_between(x_norm, 0, y_norm*(k/10), alpha=0.015, color=COLORS['down'], linewidth=0)", "href": "sources/empirical.residual_diagnostics/original.html#L44" }, { "line": 52, "end_line": 52, "code": "ml, sl, bl = ax.stem(range(n), cooks, linefmt='-', markerfmt=',', basefmt='')", "href": "sources/empirical.residual_diagnostics/original.html#L52" }, { "line": 55, "end_line": 55, "code": "ax.scatter(np.where(influential)[0], cooks[influential], color=COLORS['down'], s=25, zorder=5, edgecolor='white')", "href": "sources/empirical.residual_diagnostics/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.marginal_effects", "display_name": "边际效应与条件预测双面板", "tags": [ "因果", "解释", "组合" ], "purpose": "调节变量如何改变效应方向和条件预测?", "data_requirements": [ "调节网格上的边际效应与SE", "两种条件预测及区间" ], "composition": "左边际效应;右高低条件预测线", "visual_features": [ "多层透明置信带", "显著区域浅底", "零交叉点箭头" ], "adaptation_notes": "示例为直接设定曲线,未拟合交互模型;区间需与模型和条件定义一致。", "number": 55, "kind": "recipe", "legacy_title": "Moderation / Marginal Effects", "legacy_ref": "empirical #9", "source": { "original_code": "sources/empirical.marginal_effects/original.py", "execution_code": "sources/empirical.marginal_effects/render.py", "recipe_section": "sources/empirical.marginal_effects/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "227c6fff50703586678506425430ce8a5dddd4a529ec088da00172bb70f0b8b8", "code_sha256": "6c13cfdb5f04f750e838b5966dc916066e7f35e960e1c4e9e38d5cee5d13dc74", "execution_sha256": "6c13cfdb5f04f750e838b5966dc916066e7f35e960e1c4e9e38d5cee5d13dc74", "code_view": "sources/empirical.marginal_effects/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.marginal_effects-1.png", "thumbnail": "thumbnails/empirical.marginal_effects-1.jpg", "sha256": "a2648787f1117d29bc09b6a52f0f957df76b096997257a6fd5001c1c74a42265", "pixels": [ 2340, 900 ], "native_inches": [ 13.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 12, "operation": "fill_between", "code": " ax1.fill_between(x, me - frac*1.96*se, me + frac*1.96*se, alpha=0.03, color=PALETTE[0], linewidth=0)" }, { "line": 15, "operation": "fill_between", "code": "ax1.fill_between(x, -0.3, 0.5, where=sig_mask, alpha=0.06, color=COLORS['up'], zorder=0, label='Significant')" }, { "line": 16, "operation": "fill_between", "code": "ax1.fill_between(x, -0.3, 0.5, where=~sig_mask, alpha=0.04, color=COLORS['down'], zorder=0, label='Non-significant')" }, { "line": 17, "operation": "plot", "code": "ax1.plot(x, me, color=PALETTE[0], linewidth=2.5, zorder=5)" }, { "line": 21, "operation": "plot", "code": "ax1.plot(cross_x, 0, 'o', color=PALETTE[1], markersize=12, zorder=6, markeredgecolor='white', markeredgewidth=2)" }, { "line": 35, "operation": "fill_between", "code": " ax2.fill_between(x2, yh-frac*1.96*se2, yh+frac*1.96*se2, alpha=0.03, color=PALETTE[0], linewidth=0)" }, { "line": 36, "operation": "fill_between", "code": " ax2.fill_between(x2, yl-frac*1.96*se2, yl+frac*1.96*se2, alpha=0.03, color=PALETTE[1], linewidth=0)" }, { "line": 37, "operation": "plot", "code": "ax2.plot(x2, yh, '-', color=PALETTE[0], linewidth=2.5, label='High (+1SD)')" }, { "line": 38, "operation": "plot", "code": "ax2.plot(x2, yl, '--', color=PALETTE[1], linewidth=2.5, label='Low (−1SD)')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.marginal_effects.md", "fidelity_checkpoints": [ { "feature": "效应与条件预测双面板", "preserve": "保留左侧多层效应区间、显著区域浅底与零交叉标记,右侧高低条件预测实虚线和各自区间。", "allowed_adaptation": "条件值、效应、标准误和零交叉由当前模型计算;无交叉或无显著区时不硬保留标记。", "evidence": [ { "line": 12, "end_line": 12, "code": " ax1.fill_between(x, me - frac*1.96*se, me + frac*1.96*se, alpha=0.03, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.marginal_effects/original.html#L12" }, { "line": 15, "end_line": 15, "code": "ax1.fill_between(x, -0.3, 0.5, where=sig_mask, alpha=0.06, color=COLORS['up'], zorder=0, label='Significant')", "href": "sources/empirical.marginal_effects/original.html#L15" }, { "line": 16, "end_line": 16, "code": "ax1.fill_between(x, -0.3, 0.5, where=~sig_mask, alpha=0.04, color=COLORS['down'], zorder=0, label='Non-significant')", "href": "sources/empirical.marginal_effects/original.html#L16" }, { "line": 17, "end_line": 17, "code": "ax1.plot(x, me, color=PALETTE[0], linewidth=2.5, zorder=5)", "href": "sources/empirical.marginal_effects/original.html#L17" }, { "line": 21, "end_line": 21, "code": "ax1.plot(cross_x, 0, 'o', color=PALETTE[1], markersize=12, zorder=6, markeredgecolor='white', markeredgewidth=2)", "href": "sources/empirical.marginal_effects/original.html#L21" }, { "line": 35, "end_line": 35, "code": " ax2.fill_between(x2, yh-frac*1.96*se2, yh+frac*1.96*se2, alpha=0.03, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.marginal_effects/original.html#L35" }, { "line": 36, "end_line": 36, "code": " ax2.fill_between(x2, yl-frac*1.96*se2, yl+frac*1.96*se2, alpha=0.03, color=PALETTE[1], linewidth=0)", "href": "sources/empirical.marginal_effects/original.html#L36" }, { "line": 37, "end_line": 37, "code": "ax2.plot(x2, yh, '-', color=PALETTE[0], linewidth=2.5, label='High (+1SD)')", "href": "sources/empirical.marginal_effects/original.html#L37" }, { "line": 38, "end_line": 38, "code": "ax2.plot(x2, yl, '--', color=PALETTE[1], linewidth=2.5, label='Low (−1SD)')", "href": "sources/empirical.marginal_effects/original.html#L38" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.subgroup_forest", "display_name": "分层异质性森林图", "tags": [ "比较", "误差", "因果" ], "purpose": "效应在地区、规模等分层中是否不同?", "data_requirements": [ "分层类别下的效应、SE、权重", "分层汇总与异质性统计" ], "composition": "分组行块;点区间;每块汇总菱形", "visual_features": [ "浅色组标题带", "空实心点", "权重文字列" ], "adaptation_notes": "预览为窄高图,完整阅读需放大;I²及Q检验是示例输入,不自动估计。", "number": 56, "kind": "recipe", "legacy_title": "Subgroup Forest / Heterogeneity", "legacy_ref": "empirical #10", "source": { "original_code": "sources/empirical.subgroup_forest/original.py", "execution_code": "sources/empirical.subgroup_forest/render.py", "recipe_section": "sources/empirical.subgroup_forest/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "c2346e2cc03fd53c823b4c7508517ebc63cc81092e59170ba4579260ecd7bed0", "code_sha256": "d935a304190af847e5935a97da97b10401501ad1b114f855be58840fa1e0d7c0", "execution_sha256": "d935a304190af847e5935a97da97b10401501ad1b114f855be58840fa1e0d7c0", "code_view": "sources/empirical.subgroup_forest/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.subgroup_forest-1.png", "thumbnail": "thumbnails/empirical.subgroup_forest-1.jpg", "sha256": "1962475335bf229a9a0574455db27797afb0b8f4c95e599c03fd3043d1a08cd9", "pixels": [ 1800, 2115 ], "native_inches": [ 10.0, 11.75 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 28, "operation": "plot", "code": " ax.plot([lo, hi], [yp, yp], color=COLORS['text'], linewidth=1.0, zorder=2)" }, { "line": 29, "operation": "plot", "code": " ax.plot([lo, lo], [yp-.12, yp+.12], color=COLORS['text'], linewidth=1.0)" }, { "line": 30, "operation": "plot", "code": " ax.plot([hi, hi], [yp-.12, yp+.12], color=COLORS['text'], linewidth=1.0)" }, { "line": 32, "operation": "plot", "code": " ax.plot(c, yp, 'o', color=fc, markersize=ms, markeredgecolor=ec, markeredgewidth=1.2, zorder=3)" }, { "line": 37, "operation": "fill", "code": " ax.fill([plo,pc,phi,pc], [yp,yp+dh,yp,yp-dh], color=gc, alpha=0.7, zorder=4)" }, { "line": 38, "operation": "plot", "code": " ax.plot([plo,pc,phi,pc,plo], [yp,yp+dh,yp,yp-dh,yp], color=gc, linewidth=0.8, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "subgroup forest", "异质性" ], "related_ids": [ "empirical.forest", "advanced.dot_ci" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.subgroup_forest.md", "fidelity_checkpoints": [ { "feature": "分组行块和组内汇总", "preserve": "保留浅组标题带、各行点区间与每组汇总菱形,点与文字列对齐。", "allowed_adaptation": "亚组数量、权重和区间可变;没有有效组内汇总时说明,不直接平均区间。", "evidence": [ { "line": 23, "end_line": 23, "code": " ax.axhspan(yp-0.4, yp+0.4, color=gc, alpha=0.08, zorder=0)", "href": "sources/empirical.subgroup_forest/original.html#L23" }, { "line": 28, "end_line": 28, "code": " ax.plot([lo, hi], [yp, yp], color=COLORS['text'], linewidth=1.0, zorder=2)", "href": "sources/empirical.subgroup_forest/original.html#L28" }, { "line": 29, "end_line": 29, "code": " ax.plot([lo, lo], [yp-.12, yp+.12], color=COLORS['text'], linewidth=1.0)", "href": "sources/empirical.subgroup_forest/original.html#L29" }, { "line": 30, "end_line": 30, "code": " ax.plot([hi, hi], [yp-.12, yp+.12], color=COLORS['text'], linewidth=1.0)", "href": "sources/empirical.subgroup_forest/original.html#L30" }, { "line": 32, "end_line": 32, "code": " ax.plot(c, yp, 'o', color=fc, markersize=ms, markeredgecolor=ec, markeredgewidth=1.2, zorder=3)", "href": "sources/empirical.subgroup_forest/original.html#L32" }, { "line": 37, "end_line": 37, "code": " ax.fill([plo,pc,phi,pc], [yp,yp+dh,yp,yp-dh], color=gc, alpha=0.7, zorder=4)", "href": "sources/empirical.subgroup_forest/original.html#L37" }, { "line": 38, "end_line": 38, "code": " ax.plot([plo,pc,phi,pc,plo], [yp,yp+dh,yp,yp-dh,yp], color=gc, linewidth=0.8, zorder=5)", "href": "sources/empirical.subgroup_forest/original.html#L38" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.quantile_regression", "display_name": "分位数回归与OLS对照", "tags": [ "解释", "误差", "比较" ], "purpose": "效应在响应分布不同分位是否变化?", "data_requirements": [ "各分位系数与SE", "OLS系数及SE" ], "composition": "分位数横轴;系数曲线;OLS水平参考", "visual_features": [ "十层区间带", "OLS浅带", "差值填充", "显著性背景" ], "adaptation_notes": "示例未拟合回归;不同模型的区间与样本口径需一致;色带不是响应变量分布。", "number": 57, "kind": "recipe", "legacy_title": "Quantile Regression", "legacy_ref": "empirical #11", "source": { "original_code": "sources/empirical.quantile_regression/original.py", "execution_code": "sources/empirical.quantile_regression/render.py", "recipe_section": "sources/empirical.quantile_regression/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "ff7871f535bee39f3066adb21ce8acb55a9f50ef66a025e5024d810dcd6c834c", "code_sha256": "7bed2d0a7a1b37e630ee9acce8a314b2114d757c97a9dac995904a661d449064", "execution_sha256": "7bed2d0a7a1b37e630ee9acce8a314b2114d757c97a9dac995904a661d449064", "code_view": "sources/empirical.quantile_regression/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.quantile_regression-1.png", "thumbnail": "thumbnails/empirical.quantile_regression-1.jpg", "sha256": "a5dc0d2629768e7b682f4f7a4dea5147c9e756f0075daf3877dbecfe9d098cb6", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 13, "operation": "fill_between", "code": " ax.fill_between(q, c-frac*1.96*se, c+frac*1.96*se, alpha=0.03, color=PALETTE[0], linewidth=0)" }, { "line": 15, "operation": "fill_between", "code": "ax.fill_between(q, ols-1.96*ols_se, ols+1.96*ols_se, alpha=0.12, color=PALETTE[1], linewidth=0, label='OLS 95% CI')" }, { "line": 23, "operation": "plot", "code": "ax.plot(q, c, 'o-', color=PALETTE[0], linewidth=2.5, markersize=8, markeredgecolor='white', markeredgewidth=1.2, label='QR Coefficient', zorder=5)" }, { "line": 25, "operation": "fill_between", "code": "ax.fill_between(q, c, ols, alpha=0.06, color=PALETTE[2], label='QR−OLS Gap', linewidth=0)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.quantile_regression.md", "fidelity_checkpoints": [ { "feature": "QR区间与OLS参照分离", "preserve": "保留 QR 十层区间、OLS 水平浅带和两者差值填充,不能把不同含义合为一个阴影。", "allowed_adaptation": "分位点、系数和标准误由模型计算;显著区域和差值方向据实更新。", "evidence": [ { "line": 13, "end_line": 13, "code": " ax.fill_between(q, c-frac*1.96*se, c+frac*1.96*se, alpha=0.03, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.quantile_regression/original.html#L13" }, { "line": 15, "end_line": 15, "code": "ax.fill_between(q, ols-1.96*ols_se, ols+1.96*ols_se, alpha=0.12, color=PALETTE[1], linewidth=0, label='OLS 95% CI')", "href": "sources/empirical.quantile_regression/original.html#L15" }, { "line": 16, "end_line": 16, "code": "ax.axhline(y=ols, color=PALETTE[1], linestyle='--', linewidth=1.5, alpha=0.8)", "href": "sources/empirical.quantile_regression/original.html#L16" }, { "line": 22, "end_line": 22, "code": "ax.axhline(y=0, color=COLORS['ref_line'], linestyle='-', linewidth=0.5, alpha=0.5)", "href": "sources/empirical.quantile_regression/original.html#L22" }, { "line": 23, "end_line": 24, "code": "ax.plot(q, c, 'o-', color=PALETTE[0], linewidth=2.5, markersize=8,\n markeredgecolor='white', markeredgewidth=1.2, label='QR Coefficient', zorder=5)", "href": "sources/empirical.quantile_regression/original.html#L23" }, { "line": 25, "end_line": 25, "code": "ax.fill_between(q, c, ols, alpha=0.06, color=PALETTE[2], label='QR−OLS Gap', linewidth=0)", "href": "sources/empirical.quantile_regression/original.html#L25" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.psm_balance", "display_name": "匹配前后协变量平衡图", "tags": [ "诊断", "比较", "因果" ], "purpose": "匹配后协变量差异是否缩小?", "data_requirements": [ "各协变量匹配前后标准化差异" ], "composition": "每协变量一行;两组点与改善箭头", "visual_features": [ "阈值浅色区", "圆点菱形区分", "改善率文字" ], "adaptation_notes": "模板只展示SMD,未执行匹配;负值、绝对值和接近零分母需明确,阈值按研究口径设定。", "number": 58, "kind": "recipe", "legacy_title": "PSM Balance (Love Plot)", "legacy_ref": "empirical #12", "source": { "original_code": "sources/empirical.psm_balance/original.py", "execution_code": "sources/empirical.psm_balance/render.py", "recipe_section": "sources/empirical.psm_balance/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "bad5aadacc30758be6ad162a010c810a7bb52df38950b45094fdae1674f636c9", "code_sha256": "9a7a8c89ea8838ba7554532b000a2b178eaabe97d5d32b2a098d621f2ac02195", "execution_sha256": "9a7a8c89ea8838ba7554532b000a2b178eaabe97d5d32b2a098d621f2ac02195", "code_view": "sources/empirical.psm_balance/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.psm_balance-1.png", "thumbnail": "thumbnails/empirical.psm_balance-1.jpg", "sha256": "2dc40bd54cc18fb108400d3ec4915881b653ce74f5d79a1128378b9e71dacc9e", "pixels": [ 1620, 1152 ], "native_inches": [ 9.0, 6.3999999999999995 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "scatter", "code": "ax.scatter(before, y, s=80, color=PALETTE[1], marker='o', zorder=4, label='Before', edgecolor='white')" }, { "line": 22, "operation": "scatter", "code": "ax.scatter(after, y, s=80, color=PALETTE[0], marker='D', zorder=4, label='After', edgecolor='white')" } ], "literal_colormaps": [], "aliases": [ "love plot", "SMD", "PSM", "协变量平衡" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.psm_balance.md", "fidelity_checkpoints": [ { "feature": "阈值浅区和匹配改善", "preserve": "保留阈值浅区、匹配前圆点/后菱形、逐协变量改善箭头及数值列。", "allowed_adaptation": "协变量、SMD 与阈值据实更新,方向和是否改善不能照搬示例。", "evidence": [ { "line": 11, "end_line": 11, "code": "ax.axvspan(-0.10, 0.10, color=_lighten(COLORS['up'], 0.8), alpha=0.4, zorder=0, label='Acceptable (|d|<0.10)')", "href": "sources/empirical.psm_balance/original.html#L11" }, { "line": 15, "end_line": 16, "code": " ax.annotate('', xy=(after[i], y[i]), xytext=(before[i], y[i]),\n arrowprops=dict(arrowstyle='->', color=COLORS['neutral'], lw=1.2))", "href": "sources/empirical.psm_balance/original.html#L15" }, { "line": 21, "end_line": 21, "code": "ax.scatter(before, y, s=80, color=PALETTE[1], marker='o', zorder=4, label='Before', edgecolor='white')", "href": "sources/empirical.psm_balance/original.html#L21" }, { "line": 22, "end_line": 22, "code": "ax.scatter(after, y, s=80, color=PALETTE[0], marker='D', zorder=4, label='After', edgecolor='white')", "href": "sources/empirical.psm_balance/original.html#L22" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.prediction_ci", "display_name": "时序预测与误差侧分布", "tags": [ "预测", "误差", "组合" ], "purpose": "预测跟踪真实走势怎样,误差分布如何?", "data_requirements": [ "有序真实值、预测值、预测区间", "可选:真实训练测试分界或已定义评估方案" ], "composition": "左时序实际与预测;右竖向误差直方与密度", "visual_features": [ "透明预测带", "训练测试背景", "误差指标框" ], "adaptation_notes": "右侧是残差分布,必须独立于左侧预测量的纵轴范围和刻度,不能使用sharey连接两者。训练测试划分为条件构件:没有真实标签或既定评估方案时不绘制,不自行补比例;多方法分别计算并标明指标及有效样本数,不将方法重复观测混算为一个评价值。", "number": 59, "kind": "recipe", "legacy_title": "Prediction vs Actual with CI Band", "legacy_ref": "empirical #13", "source": { "original_code": "sources/empirical.prediction_ci/original.py", "execution_code": "sources/empirical.prediction_ci/render.py", "recipe_section": "sources/empirical.prediction_ci/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "c5bb2ef7c4023ed4d164368809c19ff1bf30ec68d3fa876b45bd0aed4594cf25", "code_sha256": "dc95a1f5e907450610a7ce04127ee857460e20051c47dffa2ee4bd28fdea50e0", "execution_sha256": "dc95a1f5e907450610a7ce04127ee857460e20051c47dffa2ee4bd28fdea50e0", "code_view": "sources/empirical.prediction_ci/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.prediction_ci-1.png", "thumbnail": "thumbnails/empirical.prediction_ci-1.jpg", "sha256": "20959a39937b0d4ed28c32d42aa45b080d22b376fbd9296437a3b35e39bd5354", "pixels": [ 1980, 900 ], "native_inches": [ 11.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 30, "operation": "fill_between", "code": " ax.fill_between(t, pred-frac*(pred-ci_lower), pred+frac*(ci_upper-pred), alpha=0.025, color=PALETTE[1], linewidth=0)" }, { "line": 33, "operation": "plot", "code": "ax.plot(t, actual, color=PALETTE[0], linewidth=1.8, label='Actual', zorder=4)" }, { "line": 34, "operation": "plot", "code": "ax.plot(t, pred, color=PALETTE[1], linewidth=1.5, linestyle='--', label='Predicted', zorder=3)" }, { "line": 49, "operation": "hist", "code": "ax_hist.hist(errors, bins=25, orientation='horizontal', color=_lighten(PALETTE[1], 0.4), alpha=0.5, edgecolor=PALETTE[1], linewidth=0.8, density=True)" }, { "line": 51, "operation": "plot", "code": "ax_hist.plot(kde(y_kde), y_kde, color=PALETTE[1], linewidth=1.5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.fan", "advanced.calibration", "competition.prediction_actual" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.prediction_ci.md", "fidelity_checkpoints": [ { "feature": "预测带与侧边误差分布", "preserve": "保留主图逐层叠加的透明预测带(本示例为12层alpha=0.025)、实际/预测线型区分,以及右侧竖向误差直方和密度;不能把分层带直接替换成一次实色填充。 侧栏保留独立数值刻度和残差单位;演示为任意单位a.u.,接入数据时替换为实际单位。", "allowed_adaptation": "真实区间端点决定色带外边界,内层仅表示视觉渐变,不宣称额外置信水平。仅有真实训练/测试标签或已定义的评估方案时保留分界;没有时移除这组背景、分界和训练/测试文字,不自行发明70/30或80/20划分。指标使用明确的真实样本范围,多方法分别计算并标明n、MAE和RMSE;不得把多个方法的同一批观测合并冒充独立样本。多站点可复用主图+误差侧栏并留足轴标签间距;残差纵轴和预测量纵轴独立设置,保留各自可读的数值刻度与单位。", "evidence": [ { "line": 19, "end_line": 19, "code": "ax.axvspan(0, split_point, color=_lighten(PALETTE[0], 0.8), alpha=0.3, zorder=0)", "href": "sources/empirical.prediction_ci/original.html#L19" }, { "line": 20, "end_line": 20, "code": "ax.axvspan(split_point, 100, color=_lighten(COLORS['highlight'], 0.8), alpha=0.3, zorder=0)", "href": "sources/empirical.prediction_ci/original.html#L20" }, { "line": 30, "end_line": 31, "code": " ax.fill_between(t, pred-frac*(pred-ci_lower), pred+frac*(ci_upper-pred),\n alpha=0.025, color=PALETTE[1], linewidth=0)", "href": "sources/empirical.prediction_ci/original.html#L30" }, { "line": 33, "end_line": 33, "code": "ax.plot(t, actual, color=PALETTE[0], linewidth=1.8, label='Actual', zorder=4)", "href": "sources/empirical.prediction_ci/original.html#L33" }, { "line": 34, "end_line": 34, "code": "ax.plot(t, pred, color=PALETTE[1], linewidth=1.5, linestyle='--', label='Predicted', zorder=3)", "href": "sources/empirical.prediction_ci/original.html#L34" }, { "line": 49, "end_line": 49, "code": "ax_hist.hist(errors, bins=25, orientation='horizontal', color=_lighten(PALETTE[1], 0.4), alpha=0.5, edgecolor=PALETTE[1], linewidth=0.8, density=True)", "href": "sources/empirical.prediction_ci/original.html#L49" }, { "line": 51, "end_line": 51, "code": "ax_hist.plot(kde(y_kde), y_kde, color=PALETTE[1], linewidth=1.5)", "href": "sources/empirical.prediction_ci/original.html#L51" }, { "line": 54, "end_line": 57, "code": "ax_hist.set_ylabel('Actual − predicted (a.u.)', fontsize=9)\nax_hist.yaxis.set_label_position('right')\nax_hist.yaxis.tick_right()\nax_hist.tick_params(axis='y', labelsize=8, labelleft=False, labelright=True)", "href": "sources/empirical.prediction_ci/original.html#L54" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。", "review_requirements": { "quantitative_axes": [ { "method": "hist", "orientation": "horizontal", "axis": "y" } ] } }, { "id": "empirical.prediction_accuracy_heatmap", "display_name": "多模型多指标预测热力排名", "tags": [ "预测", "比较", "矩阵" ], "purpose": "多个模型的误差与拟合指标如何综合比较?", "data_requirements": [ "模型×评价指标矩阵", "指标高低优方向" ], "composition": "模型行、指标列;侧边均分;色条", "visual_features": [ "原值与名次", "优胜边框", "黄红色阶" ], "adaptation_notes": "代码归一化0为优、1为劣,色条文字却反向;浅色格白字偏淡;卡片保留此限制供适配参考。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 60, "kind": "recipe", "legacy_title": "Multi-Model Prediction Accuracy Heatmap", "legacy_ref": "empirical #14", "source": { "original_code": "sources/empirical.prediction_accuracy_heatmap/original.py", "execution_code": "sources/empirical.prediction_accuracy_heatmap/render.py", "recipe_section": "sources/empirical.prediction_accuracy_heatmap/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "6e72911e57706e2e920352f481edd849f05b766c4970321a72309eb1f79fd71f", "code_sha256": "a799fc6137913210bace4b7dbb055dd54fc0698ef15cefd4532f9fd9fea36db5", "execution_sha256": "a799fc6137913210bace4b7dbb055dd54fc0698ef15cefd4532f9fd9fea36db5", "code_view": "sources/empirical.prediction_accuracy_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.prediction_accuracy_heatmap-1.png", "thumbnail": "thumbnails/empirical.prediction_accuracy_heatmap-1.jpg", "sha256": "826227d05ebe032730275725637d53f54710dffb1dcb18880a461a7ed57168a3", "pixels": [ 1693, 1080 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 21, "operation": "imshow", "code": "im = ax.imshow(norm, cmap=palette_cmap('sequential'), aspect='auto', vmin=0, vmax=1)" }, { "line": 34, "operation": "add_patch", "code": "ax.add_patch(plt.Rectangle((j-0.5, i-0.5), 1, 1, linewidth=2.5," } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.latent_interpolation", "competition.radar", "advanced.parallel_coordinates", "advanced.method_heatmap" ], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.prediction_accuracy_heatmap.md", "fidelity_checkpoints": [ { "feature": "原值名次与优胜边框", "preserve": "保留归一化着色、格内原值与名次、每指标优胜框和侧边汇总;框依据优劣方向确定。", "allowed_adaptation": "模型数、指标数、方向与综合方式可变,不把小误差当低表现。", "evidence": [ { "line": 21, "end_line": 21, "code": "im = ax.imshow(norm, cmap=palette_cmap('sequential'), aspect='auto', vmin=0, vmax=1)", "href": "sources/empirical.prediction_accuracy_heatmap/original.html#L21" }, { "line": 31, "end_line": 32, "code": " ax.text(j, i, f'{data[i,j]:.2f}{rank_str}', ha='center', va='center',\n fontsize=9.5, fontweight=w, color=txt_color)", "href": "sources/empirical.prediction_accuracy_heatmap/original.html#L31" }, { "line": 34, "end_line": 35, "code": " ax.add_patch(plt.Rectangle((j-0.5, i-0.5), 1, 1, linewidth=2.5,\n edgecolor=COLORS['up'], facecolor='none', zorder=5))", "href": "sources/empirical.prediction_accuracy_heatmap/original.html#L34" }, { "line": 44, "end_line": 44, "code": " ax.text(len(metrics)-0.25, i, f'Avg: {avg_score[sort_idx[i]]:.2f}', ha='left', va='center', fontsize=8, color=COLORS['text'])", "href": "sources/empirical.prediction_accuracy_heatmap/original.html#L44" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.prediction_error_raincloud", "display_name": "模型误差横向雨云", "tags": [ "预测", "误差", "分布" ], "purpose": "模型误差偏移、离散和长尾怎样不同?", "data_requirements": [ "每模型逐样本预测误差" ], "composition": "逐行半密度、箱线和散点", "visual_features": [ "透明云层", "零误差线", "标准差与正态性标注" ], "adaptation_notes": "不能由RMSE单值重建误差分布;KDE带宽与尾部尺度会影响形态。", "number": 61, "kind": "recipe", "legacy_title": "Prediction Error Distribution (Rain Cloud)", "legacy_ref": "empirical #15", "source": { "original_code": "sources/empirical.prediction_error_raincloud/original.py", "execution_code": "sources/empirical.prediction_error_raincloud/render.py", "recipe_section": "sources/empirical.prediction_error_raincloud/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "33efddb46d60d150d3b194f5e863be8c06ae693ccec7dea0dd04d49b0ebdbb78", "code_sha256": "d8b4861490bf5ca3a593e25d15aa97b265a2051933f0fe8ccd2f8d56dc19bacf", "execution_sha256": "d8b4861490bf5ca3a593e25d15aa97b265a2051933f0fe8ccd2f8d56dc19bacf", "code_view": "sources/empirical.prediction_error_raincloud/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.prediction_error_raincloud-1.png", "thumbnail": "thumbnails/empirical.prediction_error_raincloud-1.jpg", "sha256": "6cfdf15c1c4d0175fb90df6e6a3f802842f3e26b7b7ca849cda4ab3cd2f1e00f", "pixels": [ 1620, 1044 ], "native_inches": [ 9.0, 5.8 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "fill_between", "code": " ax.fill_between(x_kde, y_pos, y_pos + y_kde_norm*frac, alpha=0.03, color=PALETTE[i], linewidth=0)" }, { "line": 24, "operation": "fill_between", "code": " ax.fill_between(x_kde, y_pos, y_pos + y_kde_norm, alpha=0.2, color=PALETTE[i], linewidth=0)" }, { "line": 25, "operation": "plot", "code": " ax.plot(x_kde, y_pos + y_kde_norm, color=PALETTE[i], linewidth=1.2)" }, { "line": 27, "operation": "boxplot", "code": " ax.boxplot([err], positions=[y_pos], vert=False, widths=0.18, patch_artist=True, boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2), medianprops=dict(color=COLORS['text'], linewidth=1.5), whiskerprops=dict(color=PALETTE[i]), capprops=dict(color=PALETTE[i])," }, { "line": 34, "operation": "scatter", "code": " ax.scatter(err[::4], y_pos + jitter[:len(err[::4])], s=5, alpha=0.25, color=PALETTE[i], zorder=2)" }, { "line": 40, "operation": "scatter", "code": " ax.scatter(outliers, [y_pos]*len(outliers), s=30, color=COLORS['down'], marker='x', zorder=6, linewidth=1.5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "basic.raincloud", "basic.raincloud_violin", "advanced.grouped_violin", "advanced.ridgeline", "empirical.raincloud", "academic.confusion_matrix" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.prediction_error_raincloud.md", "fidelity_checkpoints": [ { "feature": "误差云与零参考", "preserve": "保留横向误差云层、深轮廓、箱线与抖动样本,以及零误差线和异常标记。", "allowed_adaptation": "分组、带宽、异常阈值可变;误差方向、离散度和检验结果由实际预测计算。", "evidence": [ { "line": 23, "end_line": 23, "code": " ax.fill_between(x_kde, y_pos, y_pos + y_kde_norm*frac, alpha=0.03, color=PALETTE[i], linewidth=0)", "href": "sources/empirical.prediction_error_raincloud/original.html#L23" }, { "line": 24, "end_line": 24, "code": " ax.fill_between(x_kde, y_pos, y_pos + y_kde_norm, alpha=0.2, color=PALETTE[i], linewidth=0)", "href": "sources/empirical.prediction_error_raincloud/original.html#L24" }, { "line": 25, "end_line": 25, "code": " ax.plot(x_kde, y_pos + y_kde_norm, color=PALETTE[i], linewidth=1.2)", "href": "sources/empirical.prediction_error_raincloud/original.html#L25" }, { "line": 27, "end_line": 31, "code": " ax.boxplot([err], positions=[y_pos], vert=False, widths=0.18, patch_artist=True,\n boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2),\n medianprops=dict(color=COLORS['text'], linewidth=1.5),\n whiskerprops=dict(color=PALETTE[i]), capprops=dict(color=PALETTE[i]),\n flierprops=dict(marker='.', markersize=2, alpha=0.3))", "href": "sources/empirical.prediction_error_raincloud/original.html#L27" }, { "line": 34, "end_line": 34, "code": " ax.scatter(err[::4], y_pos + jitter[:len(err[::4])], s=5, alpha=0.25, color=PALETTE[i], zorder=2)", "href": "sources/empirical.prediction_error_raincloud/original.html#L34" }, { "line": 40, "end_line": 40, "code": " ax.scatter(outliers, [y_pos]*len(outliers), s=30, color=COLORS['down'], marker='x', zorder=6, linewidth=1.5)", "href": "sources/empirical.prediction_error_raincloud/original.html#L40" }, { "line": 49, "end_line": 49, "code": "ax.axvline(0, color=COLORS['down'], linestyle='--', linewidth=1.0, alpha=0.6)", "href": "sources/empirical.prediction_error_raincloud/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.multistep_decay", "display_name": "预测步长性能与模型跨度", "tags": [ "预测", "趋势", "比较" ], "purpose": "预测越远性能怎样下降,模型差距如何变化?", "data_requirements": [ "各模型按预测步长排列的指标" ], "composition": "多模型折线;模型间跨度填充", "visual_features": [ "接受阈值", "末端衰减标注", "主模型突出" ], "adaptation_notes": "填充表达模型之间的范围,不是置信区间;指标需同方向同量纲。", "number": 62, "kind": "recipe", "legacy_title": "Multi-Step Prediction Decay", "legacy_ref": "empirical #16", "source": { "original_code": "sources/empirical.multistep_decay/original.py", "execution_code": "sources/empirical.multistep_decay/render.py", "recipe_section": "sources/empirical.multistep_decay/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "1a9637dc3cb40085f95c80cfdbd76eb16aad4b0353c483fc3a8176e48838e0b9", "code_sha256": "7d7660723e060cafe19ef9e8522cb6b0f7ffeb896b34c0f19b6243b404c2913b", "execution_sha256": "7d7660723e060cafe19ef9e8522cb6b0f7ffeb896b34c0f19b6243b404c2913b", "code_view": "sources/empirical.multistep_decay/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.multistep_decay-1.png", "thumbnail": "thumbnails/empirical.multistep_decay-1.jpg", "sha256": "e84bb47a5a241e962ce4d48d865d9068c880953128fd253531dc0aa7d68659ff", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 19, "operation": "fill_between", "code": " ax.fill_between(steps, worst_line, worst_line+frac*(best_line-worst_line), alpha=0.02, color=PALETTE[0], linewidth=0)" }, { "line": 21, "operation": "fill_between", "code": "ax.fill_between(steps, worst_line, best_line, alpha=0.06, color=PALETTE[0], linewidth=0, label='Model Spread')" }, { "line": 33, "operation": "plot", "code": " ax.plot(steps, acc, f'{markers[i]}-', color=PALETTE[i], linewidth=lw, markersize=ms, label=name, markeredgecolor='white', markeredgewidth=0.8, zorder=5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "competition.multistep_decay" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.multistep_decay.md", "fidelity_checkpoints": [ { "feature": "模型间跨度的叠层填充", "preserve": "保留最差到最好模型间的多层跨度填充和主次折线、阈值参考;跨度不是每模型置信区间。", "allowed_adaptation": "步数、方法、真实跨度和接受阈值可变,末端衰减标注重算。", "evidence": [ { "line": 19, "end_line": 20, "code": " ax.fill_between(steps, worst_line, worst_line+frac*(best_line-worst_line),\n alpha=0.02, color=PALETTE[0], linewidth=0)", "href": "sources/empirical.multistep_decay/original.html#L19" }, { "line": 21, "end_line": 21, "code": "ax.fill_between(steps, worst_line, best_line, alpha=0.06, color=PALETTE[0], linewidth=0, label='Model Spread')", "href": "sources/empirical.multistep_decay/original.html#L21" }, { "line": 24, "end_line": 24, "code": "ax.axhline(y=threshold, color=COLORS['up'], linestyle='--', linewidth=1.2, alpha=0.7)", "href": "sources/empirical.multistep_decay/original.html#L24" }, { "line": 33, "end_line": 34, "code": " ax.plot(steps, acc, f'{markers[i]}-', color=PALETTE[i], linewidth=lw, markersize=ms,\n label=name, markeredgecolor='white', markeredgewidth=0.8, zorder=5)", "href": "sources/empirical.multistep_decay/original.html#L33" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.moran_scatter", "display_name": "Moran空间滞后散点", "tags": [ "空间", "关联", "诊断" ], "purpose": "地区值与邻近地区值是否存在空间关联?", "data_requirements": [ "区域边界", "每区域数值", "空间权重定义" ], "composition": "标准化值与空间滞后散点;四象限", "visual_features": [ "象限浅底", "回归线", "异常区域名", "Moran统计" ], "adaptation_notes": "此例真实计算Queen权重和Moran统计,但区域数值为模拟;边界与权重影响结论。", "number": 63, "kind": "recipe", "legacy_title": "Moran's I Scatter Plot (真实空间自相关 + esda 计算 + Queen 权重)", "legacy_ref": "empirical #17", "source": { "original_code": "sources/empirical.moran_scatter/original.py", "execution_code": "sources/empirical.moran_scatter/render.py", "recipe_section": "sources/empirical.moran_scatter/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "c33a56062e7664a9c5db7ccf45eb47059ca77931c7baefdfeb87ff62cc063621", "code_sha256": "4e0badb77db7d2c42db5870243a054cf80c08a7302f8106af99396eb23552166", "execution_sha256": "4e0badb77db7d2c42db5870243a054cf80c08a7302f8106af99396eb23552166", "code_view": "sources/empirical.moran_scatter/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.moran_scatter-1.png", "thumbnail": "thumbnails/empirical.moran_scatter-1.jpg", "sha256": "7f1abb7f10b7c97f7c2ac3f50f91a3d2c59d0a3a1dbca377d78f2f23f223143b", "pixels": [ 1260, 1170 ], "native_inches": [ 7.0, 6.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 57, "operation": "fill_between", "code": "ax.fill_between([0, xlim[1]], 0, ylim[1], alpha=0.06, color=PALETTE[0], zorder=0)" }, { "line": 58, "operation": "fill_between", "code": "ax.fill_between([xlim[0], 0], ylim[0], 0, alpha=0.06, color=PALETTE[1], zorder=0)" }, { "line": 59, "operation": "fill_between", "code": "ax.fill_between([xlim[0], 0], 0, ylim[1], alpha=0.06, color=PALETTE[2], zorder=0)" }, { "line": 60, "operation": "fill_between", "code": "ax.fill_between([0, xlim[1]], ylim[0], 0, alpha=0.06, color=PALETTE[3], zorder=0)" }, { "line": 71, "operation": "scatter", "code": " ax.scatter(z[i], wz[i], c=c, s=60, edgecolors='white', linewidths=0.8, zorder=3, alpha=0.85)" }, { "line": 75, "operation": "plot", "code": "ax.plot(x_fit, moran.I * x_fit, '--', color=COLORS['text'], linewidth=1.2, alpha=0.6, zorder=2)" } ], "literal_colormaps": [], "aliases": [ "Moran I", "空间自相关" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.moran_scatter.md", "fidelity_checkpoints": [ { "feature": "四象限浅底与空间关联", "preserve": "保留四象限浅底、象限点色、空间滞后轴与回归参考,不只剩普通散点。", "allowed_adaptation": "空间权重、标准化值、空间滞后与 Moran 统计按实际分析计算;异常区域标签据实选择。", "evidence": [ { "line": 57, "end_line": 57, "code": "ax.fill_between([0, xlim[1]], 0, ylim[1], alpha=0.06, color=PALETTE[0], zorder=0)", "href": "sources/empirical.moran_scatter/original.html#L57" }, { "line": 58, "end_line": 58, "code": "ax.fill_between([xlim[0], 0], ylim[0], 0, alpha=0.06, color=PALETTE[1], zorder=0)", "href": "sources/empirical.moran_scatter/original.html#L58" }, { "line": 59, "end_line": 59, "code": "ax.fill_between([xlim[0], 0], 0, ylim[1], alpha=0.06, color=PALETTE[2], zorder=0)", "href": "sources/empirical.moran_scatter/original.html#L59" }, { "line": 60, "end_line": 60, "code": "ax.fill_between([0, xlim[1]], ylim[0], 0, alpha=0.06, color=PALETTE[3], zorder=0)", "href": "sources/empirical.moran_scatter/original.html#L60" }, { "line": 71, "end_line": 71, "code": " ax.scatter(z[i], wz[i], c=c, s=60, edgecolors='white', linewidths=0.8, zorder=3, alpha=0.85)", "href": "sources/empirical.moran_scatter/original.html#L71" }, { "line": 75, "end_line": 75, "code": "ax.plot(x_fit, moran.I * x_fit, '--', color=COLORS['text'], linewidth=1.2, alpha=0.6, zorder=2)", "href": "sources/empirical.moran_scatter/original.html#L75" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.lisa_map", "display_name": "LISA局部空间聚类地图", "tags": [ "空间", "聚类", "诊断" ], "purpose": "高高、低低集聚与空间异常在哪里?", "data_requirements": [ "区域边界与数值", "空间权重及显著性口径" ], "composition": "行政区分类着色;显著地区文字", "visual_features": [ "HH、LL、HL、LH与不显著类别", "白边界" ], "adaptation_notes": "使用真实Moran_Local计算模拟数据;颜色为类别不应当连续大小;置换次数与多重比较需明确。", "number": 64, "kind": "recipe", "legacy_title": "LISA Cluster Map (真实局部空间自相关 + esda.Moran_Local + 中国省级地图)", "legacy_ref": "empirical #18", "source": { "original_code": "sources/empirical.lisa_map/original.py", "execution_code": "sources/empirical.lisa_map/render.py", "recipe_section": "sources/empirical.lisa_map/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "3f105c4583e355bf5ca282f7b37de84b6bd415d24dfa8f47651bce9f01a9817a", "code_sha256": "973bce69e8332215f9a82f03ff7be165e3fd6b26910f413a6594c95afe726c99", "execution_sha256": "973bce69e8332215f9a82f03ff7be165e3fd6b26910f413a6594c95afe726c99", "code_view": "sources/empirical.lisa_map/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.lisa_map-1.png", "thumbnail": "thumbnails/empirical.lisa_map-1.jpg", "sha256": "2a1245990cb285fc211015988ea97b7be5fdb3d60e867e7eda553a7dc166448d", "pixels": [ 1800, 1440 ], "native_inches": [ 10.0, 8.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 60, "operation": "plot", "code": " subset.plot(color=cluster_colors[cluster_type], edgecolor='white', linewidth=0.5, ax=ax, zorder=2 if cluster_type != 'NS' else 1)" } ], "literal_colormaps": [], "aliases": [ "LISA", "局部空间自相关" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.lisa_map.md", "fidelity_checkpoints": [ { "feature": "离散空间类别和白边界", "preserve": "保留 HH/LL/HL/LH/不显著的离散编码及白边界,不把类别变成连续强弱色阶。", "allowed_adaptation": "地理单元、权重、显著性规则和类别颜色可变,类别名称与颜色映射一致。", "evidence": [ { "line": 60, "end_line": 61, "code": " subset.plot(color=cluster_colors[cluster_type], edgecolor='white',\n linewidth=0.5, ax=ax, zorder=2 if cluster_type != 'NS' else 1)", "href": "sources/empirical.lisa_map/original.html#L60" }, { "line": 96, "end_line": 97, "code": "ax.legend(handles=legend_elements, loc='lower left', fontsize=8.5,\n frameon=False, labelspacing=0.35, handlelength=1.6, title=f'LISA 聚类 (p < {sig_level})', title_fontsize=9)", "href": "sources/empirical.lisa_map/original.html#L96" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.coefficient_stability", "display_name": "逐步控制的系数稳定性", "tags": [ "解释", "误差", "趋势" ], "purpose": "加入控制变量后核心系数是否稳定?", "data_requirements": [ "按设定顺序的系数、CI及设定名" ], "composition": "系数折线;零线和基准范围", "visual_features": [ "两层嵌套透明CI", "基准±10%浅带", "数值标签" ], "adaptation_notes": "不是连续渐变;基准范围是参考而非CI;模型顺序具有含义,不是时间变化。", "number": 65, "kind": "recipe", "legacy_title": "Coefficient Stability Plot (Sequential Control Variable Addition)", "legacy_ref": "empirical #19", "source": { "original_code": "sources/empirical.coefficient_stability/original.py", "execution_code": "sources/empirical.coefficient_stability/render.py", "recipe_section": "sources/empirical.coefficient_stability/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "f73b4fc80f916f35d581728679a43587c1011fd8acb6e8533acf2d06170c881a", "code_sha256": "41bd4714e9e7b4cbb3a7dbc8e42e298b56509e48cf652bb2aaa0f59b44e1b91a", "execution_sha256": "41bd4714e9e7b4cbb3a7dbc8e42e298b56509e48cf652bb2aaa0f59b44e1b91a", "code_view": "sources/empirical.coefficient_stability/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.coefficient_stability-1.png", "thumbnail": "thumbnails/empirical.coefficient_stability-1.jpg", "sha256": "9841bc027067e81c54a9e2104d43929f03814aafb29067cd4816a88e074d5b21", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 16, "operation": "fill_between", "code": "ax.fill_between(n_controls, ci_lower, ci_upper, alpha=0.15, color=PALETTE[0])" }, { "line": 17, "operation": "fill_between", "code": "ax.fill_between(n_controls, [c - (c - cl) * 0.5 for c, cl in zip(coefs, ci_lower)], [c + (cu - c) * 0.5 for c, cu in zip(coefs, ci_upper)], alpha=0.25, color=PALETTE[0])" }, { "line": 22, "operation": "plot", "code": "ax.plot(n_controls, coefs, 'o-', color=PALETTE[0], linewidth=2.5, markersize=8, markeredgecolor='white', markeredgewidth=1.5, zorder=5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.coefficient_stability.md", "fidelity_checkpoints": [ { "feature": "两层系数带和基准区", "preserve": "保留系数路径、两层嵌套浅带与基准范围背景,分清置信区间和基准容差。", "allowed_adaptation": "控制变量序列、系数和区间重新计算;容差按任务设定,标签可避让。", "evidence": [ { "line": 16, "end_line": 16, "code": "ax.fill_between(n_controls, ci_lower, ci_upper, alpha=0.15, color=PALETTE[0])", "href": "sources/empirical.coefficient_stability/original.html#L16" }, { "line": 17, "end_line": 19, "code": "ax.fill_between(n_controls, [c - (c - cl) * 0.5 for c, cl in zip(coefs, ci_lower)],\n [c + (cu - c) * 0.5 for c, cu in zip(coefs, ci_upper)],\n alpha=0.25, color=PALETTE[0])", "href": "sources/empirical.coefficient_stability/original.html#L17" }, { "line": 22, "end_line": 23, "code": "ax.plot(n_controls, coefs, 'o-', color=PALETTE[0], linewidth=2.5, markersize=8,\n markeredgecolor='white', markeredgewidth=1.5, zorder=5)", "href": "sources/empirical.coefficient_stability/original.html#L22" }, { "line": 35, "end_line": 36, "code": "ax.axhspan(baseline * 0.9, baseline * 1.1, alpha=0.05, color=PALETTE[3],\n label=f'基准±10% ({baseline*0.9:.3f}~{baseline*1.1:.3f})')", "href": "sources/empirical.coefficient_stability/original.html#L35" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.variance_decomposition", "display_name": "方差分解总览与次要成分放大", "tags": [ "组成", "趋势", "组合" ], "purpose": "预测误差方差由哪些冲击贡献,小项如何变化?", "data_requirements": [ "期数×冲击来源的贡献份额" ], "composition": "上完整堆叠面积;下排除主成分后放大", "visual_features": [ "共享期数", "浅色贡献带", "末端份额" ], "adaptation_notes": "下图展示次要成分原份额而非重新归一化;数值需来自真实方差分解并检验加总口径。", "number": 66, "kind": "recipe", "legacy_title": "Variance Decomposition (Stacked Area with Smart Scaling)", "legacy_ref": "empirical #20", "source": { "original_code": "sources/empirical.variance_decomposition/original.py", "execution_code": "sources/empirical.variance_decomposition/render.py", "recipe_section": "sources/empirical.variance_decomposition/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "6c8fd5b62d54c5621a60cdd64b03fa08cbfc0f931f31337108fd80337cc608b0", "code_sha256": "9bbcbf3764fa41182381d54bddc8bc8443c5c56e1d60df051217278f5657c952", "execution_sha256": "9bbcbf3764fa41182381d54bddc8bc8443c5c56e1d60df051217278f5657c952", "code_view": "sources/empirical.variance_decomposition/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.variance_decomposition-1.png", "thumbnail": "thumbnails/empirical.variance_decomposition-1.jpg", "sha256": "0e76f4ec0d3f16f779e040616006a0ccd55451b734a0cff64502a5038ea9fedc", "pixels": [ 1440, 1260 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "plot", "code": "ax1.plot(periods, own, color=PALETTE[0], linewidth=1.5)" }, { "line": 21, "operation": "plot", "code": "ax1.plot(periods, own + var2, color=PALETTE[1], linewidth=1.5)" }, { "line": 30, "operation": "fill_between", "code": "ax2.fill_between(periods, 0, var2, alpha=0.4, color=PALETTE[1], label=names[1])" }, { "line": 31, "operation": "fill_between", "code": "ax2.fill_between(periods, var2, var2 + var3, alpha=0.4, color=PALETTE[2], label=names[2])" }, { "line": 32, "operation": "plot", "code": "ax2.plot(periods, var2, color=PALETTE[1], linewidth=2, marker='o', markersize=4, markeredgecolor='white', markeredgewidth=0.8)" }, { "line": 34, "operation": "plot", "code": "ax2.plot(periods, var2 + var3, color=PALETTE[2], linewidth=2, marker='s', markersize=4, markeredgecolor='white', markeredgewidth=0.8)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "basic.area", "advanced.streamgraph" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.variance_decomposition.md", "fidelity_checkpoints": [ { "feature": "完整堆叠与次成分放大", "preserve": "保留上部全成分堆叠和下部排除主成分后的放大,浅填充与独立轮廓共同表达贡献。", "allowed_adaptation": "成分数和期数可变,上下共用同一期数,放大面板保持原份额解释,不偷偷重新归一化。", "evidence": [ { "line": 17, "end_line": 19, "code": "ax1.stackplot(periods, own, var2, var3,\n colors=[_lighten(PALETTE[0], 0.3), _lighten(PALETTE[1], 0.3), _lighten(PALETTE[2], 0.3)],\n alpha=0.8, labels=names)", "href": "sources/empirical.variance_decomposition/original.html#L17" }, { "line": 20, "end_line": 20, "code": "ax1.plot(periods, own, color=PALETTE[0], linewidth=1.5)", "href": "sources/empirical.variance_decomposition/original.html#L20" }, { "line": 21, "end_line": 21, "code": "ax1.plot(periods, own + var2, color=PALETTE[1], linewidth=1.5)", "href": "sources/empirical.variance_decomposition/original.html#L21" }, { "line": 30, "end_line": 30, "code": "ax2.fill_between(periods, 0, var2, alpha=0.4, color=PALETTE[1], label=names[1])", "href": "sources/empirical.variance_decomposition/original.html#L30" }, { "line": 31, "end_line": 31, "code": "ax2.fill_between(periods, var2, var2 + var3, alpha=0.4, color=PALETTE[2], label=names[2])", "href": "sources/empirical.variance_decomposition/original.html#L31" }, { "line": 32, "end_line": 33, "code": "ax2.plot(periods, var2, color=PALETTE[1], linewidth=2, marker='o', markersize=4,\n markeredgecolor='white', markeredgewidth=0.8)", "href": "sources/empirical.variance_decomposition/original.html#L32" }, { "line": 34, "end_line": 35, "code": "ax2.plot(periods, var2 + var3, color=PALETTE[2], linewidth=2, marker='s', markersize=4,\n markeredgecolor='white', markeredgewidth=0.8)", "href": "sources/empirical.variance_decomposition/original.html#L34" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "empirical.impulse_response", "display_name": "多路径脉冲响应四面板", "tags": [ "因果", "趋势", "误差", "组合" ], "purpose": "各类冲击对响应变量的影响如何衰减?", "data_requirements": [ "冲击—响应配对", "各期IRF与区间" ], "composition": "2×2,每格一个响应路径", "visual_features": [ "嵌套透明区间", "零线", "显著时期浅底" ], "adaptation_notes": "示例响应曲线手工设定;需提供真实模型识别、期数单位和区间估计。", "number": 67, "kind": "recipe", "legacy_title": "Impulse Response Function (IRF with Gradient CI + Multi-Panel)", "legacy_ref": "empirical #21", "source": { "original_code": "sources/empirical.impulse_response/original.py", "execution_code": "sources/empirical.impulse_response/render.py", "recipe_section": "sources/empirical.impulse_response/recipe.md", "recipe_file": "figure_recipes_empirical.md", "content_sha256": "8d9b600136179ce4824c85d1c6e6ce0d803dd1654e766cc2153151ff31f44eb1", "code_sha256": "6c4ddf4666aed1a6c877ef6744afccaae680073e1766fee4c34c2f2309918164", "execution_sha256": "6c4ddf4666aed1a6c877ef6744afccaae680073e1766fee4c34c2f2309918164", "code_view": "sources/empirical.impulse_response/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/empirical.impulse_response-1.png", "thumbnail": "thumbnails/empirical.impulse_response-1.jpg", "sha256": "171911e04cb08656cf8ae97f2ba12c25363fb34f6e2512f85a10c5c6d1dc6d96", "pixels": [ 1800, 1440 ], "native_inches": [ 10.0, 8.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 42, "operation": "fill_between", "code": " ax.fill_between(periods, mid - (mid - lower) * shrink, mid + (upper - mid) * shrink, alpha=alpha, color=PALETTE[idx % len(PALETTE)])" }, { "line": 46, "operation": "plot", "code": " ax.plot(periods, irf, '-o', color=PALETTE[idx % len(PALETTE)], linewidth=2, markersize=4, markeredgecolor='white', markeredgewidth=0.8, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "IRF", "VAR", "脉冲响应" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/empirical.impulse_response.md", "fidelity_checkpoints": [ { "feature": "响应路径与嵌套区间", "preserve": "保留各响应面板的多层透明区间、白边路径点、零线和有依据的显著时期浅底。", "allowed_adaptation": "冲击/响应变量、期数及置信界由实际模型重算,布局可扩缩,不将示例曲线当实证结果。", "evidence": [ { "line": 42, "end_line": 43, "code": " ax.fill_between(periods, mid - (mid - lower) * shrink, mid + (upper - mid) * shrink,\n alpha=alpha, color=PALETTE[idx % len(PALETTE)])", "href": "sources/empirical.impulse_response/original.html#L42" }, { "line": 46, "end_line": 47, "code": " ax.plot(periods, irf, '-o', color=PALETTE[idx % len(PALETTE)], linewidth=2,\n markersize=4, markeredgecolor='white', markeredgewidth=0.8, zorder=5)", "href": "sources/empirical.impulse_response/original.html#L46" }, { "line": 50, "end_line": 50, "code": " ax.axhline(0, color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5)", "href": "sources/empirical.impulse_response/original.html#L50" }, { "line": 55, "end_line": 55, "code": " ax.axvspan(t - 0.4, t + 0.4, alpha=0.04, color=PALETTE[idx % len(PALETTE)])", "href": "sources/empirical.impulse_response/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.ablation", "display_name": "消融配置柱状比较", "tags": [ "比较", "解释" ], "purpose": "移除组件对模型表现有何影响?", "data_requirements": [ "配置名称", "表现值", "与完整模型的差异" ], "composition": "单面板柱;配置间连接标记", "visual_features": [ "黄红数值配色", "差值箭头", "首尾柱强调" ], "adaptation_notes": "当前颜色注释与实际YlOrRd不一致;每根柱均匀填充;示例截断纵轴会放大差距。", "number": 68, "kind": "recipe", "legacy_title": "Ablation Study Bar Chart — 消融实验柱状图", "legacy_ref": "academic #1", "source": { "original_code": "sources/academic.ablation/original.py", "execution_code": "sources/academic.ablation/render.py", "recipe_section": "sources/academic.ablation/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "0be8a792c3b2ccafa2bb26e034250eef0f49823672aa55a8610d770806ee350b", "code_sha256": "75870dede0fdf262ab0b457b6da5505ba9bc7f0cee65668e0ddd2cfa7c41cb5a", "execution_sha256": "d7a3d439edf8f718075c957b1c7aec600c312f2f608446f5c7e77c183a546107", "code_view": "sources/academic.ablation/original.html" }, "title_mismatch": false, "compatibility_patches": [ "RGB/RGBA 元组转十六进制以适配原 _lighten 接口,颜色含义不变" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.ablation-1.png", "thumbnail": "thumbnails/academic.ablation-1.jpg", "sha256": "62e23696d950b0a7b2c81e6f8599dd4110635508c3b7e5820132ecf960e9a96c", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 18, "operation": "bar", "code": "bars = ax.bar(range(len(configs)), scores, color=[_lighten(c, 0.35) for c in colors], edgecolor=colors, linewidth=1.2, width=0.65, zorder=3)" }, { "line": 23, "operation": "plot", "code": " ax.plot([j + 0.325, j + 0.675], [scores[j], scores[j]], color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5, zorder=2)" }, { "line": 52, "operation": "plot", "code": "ax.plot([0, len(configs) - 1], [scores[0], scores[-1]], '--', color=COLORS['ref_line'], linewidth=1, alpha=0.4, zorder=1)" } ], "literal_colormaps": [ "YlOrRd" ], "aliases": [], "related_ids": [ "advanced.waterfall", "competition.waterfall", "advanced.diverging_bar" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.ablation.md", "fidelity_checkpoints": [ { "feature": "浅柱、连接和增益标记", "preserve": "保留随得分变化的浅填色与深边、首尾强调及增益连接标记。", "allowed_adaptation": "配置顺序、得分、增益方向和范围按实验更新;对无逐步关系的配置不伪造累积链条。", "evidence": [ { "line": 18, "end_line": 19, "code": "bars = ax.bar(range(len(configs)), scores, color=[_lighten(c, 0.35) for c in colors],\n edgecolor=colors, linewidth=1.2, width=0.65, zorder=3)", "href": "sources/academic.ablation/original.html#L18" }, { "line": 23, "end_line": 24, "code": " ax.plot([j + 0.325, j + 0.675], [scores[j], scores[j]],\n color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5, zorder=2)", "href": "sources/academic.ablation/original.html#L23" }, { "line": 32, "end_line": 36, "code": " ax.annotate(f'↓{drop:.1f}',\n xy=(bar.get_x() + bar.get_width() / 2, bar.get_height() - 1),\n fontsize=8, ha='center', va='top', color='white', fontweight='bold',\n bbox=dict(boxstyle='round,pad=0.15', facecolor=COLORS['down'],\n alpha=0.7, edgecolor='none'))", "href": "sources/academic.ablation/original.html#L32" }, { "line": 52, "end_line": 53, "code": "ax.plot([0, len(configs) - 1], [scores[0], scores[-1]], '--',\n color=COLORS['ref_line'], linewidth=1, alpha=0.4, zorder=1)", "href": "sources/academic.ablation/original.html#L52" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.training_curves", "display_name": "损失准确率双轴与学习率插图", "tags": [ "训练", "趋势", "诊断", "组合" ], "purpose": "训练验证过程、最佳轮次和学习率如何关联?", "data_requirements": [ "epoch", "训练验证损失与指标", "学习率序列" ], "composition": "主图双轴四曲线;右侧学习率小窗", "visual_features": [ "损失下三层透明填充", "最佳轮次星号", "早停线" ], "adaptation_notes": "示例早停为最佳轮次加10,未运行早停算法;图例靠近曲线;不是独立学习率调度模板。", "number": 69, "kind": "recipe", "legacy_title": "Training Curves — 训练曲线(Loss + Metric 双轴)", "legacy_ref": "academic #2", "source": { "original_code": "sources/academic.training_curves/original.py", "execution_code": "sources/academic.training_curves/render.py", "recipe_section": "sources/academic.training_curves/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "c75e9ff275c0a89a7bf7e276775c6f1cef0d15271c55fa5a77c1491044c27f6a", "code_sha256": "2745ee1de2711c500d27d913a5910389f9e482f6e9710dfd389dd8b8168ff138", "execution_sha256": "2745ee1de2711c500d27d913a5910389f9e482f6e9710dfd389dd8b8168ff138", "code_view": "sources/academic.training_curves/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.training_curves-1.png", "thumbnail": "thumbnails/academic.training_curves-1.jpg", "sha256": "bc154599ab19d39640fc9a2d6d8f8733da1baa42e74953b274a94068e9bea3a1", "pixels": [ 1440, 900 ], "native_inches": [ 8.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "plot", "code": "l1, = ax1.plot(epochs, train_loss, color=PALETTE[0], linewidth=1.8, label='Train Loss')" }, { "line": 22, "operation": "plot", "code": "l2, = ax1.plot(epochs, val_loss, color=PALETTE[0], linewidth=1.8, linestyle='--', label='Val Loss', alpha=0.7)" }, { "line": 26, "operation": "fill_between", "code": " ax1.fill_between(epochs, train_loss.min() - 0.1 + layer * 0.05, train_loss - layer * 0.03, alpha=alpha, color=PALETTE[0], linewidth=0)" }, { "line": 31, "operation": "plot", "code": "l3, = ax2.plot(epochs, train_acc, color=PALETTE[1], linewidth=1.8, label='Train Acc')" }, { "line": 32, "operation": "plot", "code": "l4, = ax2.plot(epochs, val_acc, color=PALETTE[1], linewidth=1.8, linestyle='--', label='Val Acc', alpha=0.7)" }, { "line": 37, "operation": "scatter", "code": "ax1.scatter(best_epoch, val_loss[best_epoch - 1], marker='*', s=200, color=COLORS['down'], edgecolor='white', linewidth=1, zorder=6)" }, { "line": 56, "operation": "plot", "code": "ax_inset.plot(epochs, lr * 1000, color=PALETTE[2], linewidth=1.2)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "competition.convergence", "advanced.performance_profile" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.training_curves.md", "fidelity_checkpoints": [ { "feature": "损失填充与学习率小窗", "preserve": "保留双轴训练/验证线型差异、损失下三层填充、最佳点与学习率小窗。", "allowed_adaptation": "轮次、学习率、早停和最优位置来自实际日志;透明填充是视觉层,不伪装为重复试验波动。", "evidence": [ { "line": 21, "end_line": 21, "code": "l1, = ax1.plot(epochs, train_loss, color=PALETTE[0], linewidth=1.8, label='Train Loss')", "href": "sources/academic.training_curves/original.html#L21" }, { "line": 22, "end_line": 23, "code": "l2, = ax1.plot(epochs, val_loss, color=PALETTE[0], linewidth=1.8, linestyle='--',\n label='Val Loss', alpha=0.7)", "href": "sources/academic.training_curves/original.html#L22" }, { "line": 26, "end_line": 28, "code": " ax1.fill_between(epochs, train_loss.min() - 0.1 + layer * 0.05,\n train_loss - layer * 0.03,\n alpha=alpha, color=PALETTE[0], linewidth=0)", "href": "sources/academic.training_curves/original.html#L26" }, { "line": 31, "end_line": 31, "code": "l3, = ax2.plot(epochs, train_acc, color=PALETTE[1], linewidth=1.8, label='Train Acc')", "href": "sources/academic.training_curves/original.html#L31" }, { "line": 32, "end_line": 33, "code": "l4, = ax2.plot(epochs, val_acc, color=PALETTE[1], linewidth=1.8, linestyle='--',\n label='Val Acc', alpha=0.7)", "href": "sources/academic.training_curves/original.html#L32" }, { "line": 37, "end_line": 38, "code": "ax1.scatter(best_epoch, val_loss[best_epoch - 1], marker='*', s=200, color=COLORS['down'],\n edgecolor='white', linewidth=1, zorder=6)", "href": "sources/academic.training_curves/original.html#L37" }, { "line": 49, "end_line": 49, "code": "ax1.axvline(x=early_stop, color=COLORS['ref_line'], linestyle=':', linewidth=1, alpha=0.6)", "href": "sources/academic.training_curves/original.html#L49" }, { "line": 56, "end_line": 56, "code": "ax_inset.plot(epochs, lr * 1000, color=PALETTE[2], linewidth=1.2)", "href": "sources/academic.training_curves/original.html#L56" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.tsne_umap", "display_name": "二维嵌入簇与密度轮廓", "tags": [ "降维", "聚类", "分布" ], "purpose": "二维嵌入中类别是否分离和混杂?", "data_requirements": [ "已有二维嵌入坐标", "类别标签" ], "composition": "分组散点;类内密度轮廓与包络", "visual_features": [ "透明点云", "虚线轮廓", "类中心标签" ], "adaptation_notes": "代码直接模拟二维簇,未计算t-SNE/UMAP;轮廓不自动代表置信区域。", "number": 70, "kind": "recipe", "legacy_title": "t-SNE / UMAP Visualization — 降维可视化", "legacy_ref": "academic #3", "source": { "original_code": "sources/academic.tsne_umap/original.py", "execution_code": "sources/academic.tsne_umap/render.py", "recipe_section": "sources/academic.tsne_umap/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "648f109535af28ef3f9dce88e3ac5a429240fcc3bcf4f0acb20565ef57a3623b", "code_sha256": "4a9dab21570289bd54fd12e1dac05e13cb4323c6b5a7bb8448cad57b44361c93", "execution_sha256": "4a9dab21570289bd54fd12e1dac05e13cb4323c6b5a7bb8448cad57b44361c93", "code_view": "sources/academic.tsne_umap/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.tsne_umap-1.png", "thumbnail": "thumbnails/academic.tsne_umap-1.jpg", "sha256": "454f5815c7a2d40aeea3e3538e9cb4c86afd1cf20b4b9a6b8d7e8a63cfa57bd1", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 32, "operation": "contourf", "code": " ax.contourf(Xg, Yg, Z, levels=5, cmap=plt.cm.Blues if i == 0 else plt.cm.Oranges if i == 1 else plt.cm.Greens if i == 2 else plt.cm.Purples, alpha=0.15)" }, { "line": 35, "operation": "contour", "code": " ax.contour(Xg, Yg, Z, levels=3, colors=PALETTE[i], alpha=0.3, linewidths=0.5)" }, { "line": 45, "operation": "add_patch", "code": " ax.add_patch(ellipse)" }, { "line": 48, "operation": "scatter", "code": " ax.scatter(pts[:, 0], pts[:, 1], s=10, alpha=0.45, color=PALETTE[i], label=cls, edgecolor='none')" } ], "literal_colormaps": [ "Blues", "Greens", "Oranges", "Purples" ], "aliases": [], "related_ids": [ "academic.benchmark_table", "competition.cluster_3d", "competition.kmeans" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.tsne_umap.md", "fidelity_checkpoints": [ { "feature": "点云、密度与类包络", "preserve": "保留透明点云、浅类内密度、轮廓/包络与中心标签,不把所有类统一成实色点。", "allowed_adaptation": "类数、降维坐标和密度带宽可变;小样本或退化类不强行拟合包络,连续背景色按当前指导适配。", "evidence": [ { "line": 32, "end_line": 34, "code": " ax.contourf(Xg, Yg, Z, levels=5, cmap=plt.cm.Blues if i == 0 else\n plt.cm.Oranges if i == 1 else plt.cm.Greens if i == 2 else plt.cm.Purples,\n alpha=0.15)", "href": "sources/academic.tsne_umap/original.html#L32" }, { "line": 35, "end_line": 35, "code": " ax.contour(Xg, Yg, Z, levels=3, colors=PALETTE[i], alpha=0.3, linewidths=0.5)", "href": "sources/academic.tsne_umap/original.html#L35" }, { "line": 42, "end_line": 44, "code": " ellipse = Ellipse(xy=pts.mean(axis=0), width=width, height=height, angle=angle,\n facecolor='none', edgecolor=PALETTE[i], linewidth=1.2,\n linestyle='--', alpha=0.6)", "href": "sources/academic.tsne_umap/original.html#L42" }, { "line": 48, "end_line": 49, "code": " ax.scatter(pts[:, 0], pts[:, 1], s=10, alpha=0.45, color=PALETTE[i],\n label=cls, edgecolor='none')", "href": "sources/academic.tsne_umap/original.html#L48" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.attention_heatmap", "display_name": "注意力矩阵与双侧聚类树", "tags": [ "解释", "矩阵", "聚类" ], "purpose": "Query对Key的权重怎样分配?", "data_requirements": [ "注意力权重矩阵", "行列token", "可选熵统计" ], "composition": "热图+顶部及左侧树;右侧熵与色条", "visual_features": [ "黄红色阶", "较大权重数字", "白格线" ], "adaptation_notes": "树与矩阵顺序需核对;左侧标签靠近树;聚类后需保留token对应关系。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 71, "kind": "recipe", "legacy_title": "Attention Heatmap — 注意力热力图", "legacy_ref": "academic #4", "source": { "original_code": "sources/academic.attention_heatmap/original.py", "execution_code": "sources/academic.attention_heatmap/render.py", "recipe_section": "sources/academic.attention_heatmap/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "8e7259092772ebc8232c207ca43562e556b82418c3c7cce3513f8dc30c37fcb3", "code_sha256": "aa5347a9a06bd652f05d1282d02a821bf4f98abbe43022f0a55afb7ca4672ee7", "execution_sha256": "aa5347a9a06bd652f05d1282d02a821bf4f98abbe43022f0a55afb7ca4672ee7", "code_view": "sources/academic.attention_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.attention_heatmap-1.png", "thumbnail": "thumbnails/academic.attention_heatmap-1.jpg", "sha256": "dc917ba978f85033b24dad97855bc6a2b934ed4dc53bb33f50d988400dd400e9", "pixels": [ 1416, 1388 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 26, "operation": "dendrogram", "code": "dendrogram(Z_col, ax=ax_dtop, no_labels=True, color_threshold=0," }, { "line": 36, "operation": "dendrogram", "code": "dendrogram(Z_row, ax=ax_dleft, orientation='left', no_labels=True," }, { "line": 45, "operation": "imshow", "code": "im = ax_heat.imshow(attn, cmap=palette_cmap('sequential'), aspect='auto')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.attention_heatmap.md", "fidelity_checkpoints": [ { "feature": "注意力矩阵与边侧摘要", "preserve": "保留热图与聚类树对应关系、较大权重注释、侧熵摘要与色条,不仅画矩阵。", "allowed_adaptation": "token 数、重排和字体可变;注意力归一化与熵计算来自真实权重。", "evidence": [ { "line": 26, "end_line": 27, "code": "dendrogram(Z_col, ax=ax_dtop, no_labels=True, color_threshold=0,\n above_threshold_color=PALETTE[0])", "href": "sources/academic.attention_heatmap/original.html#L26" }, { "line": 36, "end_line": 37, "code": "dendrogram(Z_row, ax=ax_dleft, orientation='left', no_labels=True,\n color_threshold=0, above_threshold_color=PALETTE[0])", "href": "sources/academic.attention_heatmap/original.html#L36" }, { "line": 45, "end_line": 45, "code": "im = ax_heat.imshow(attn, cmap=palette_cmap('sequential'), aspect='auto')", "href": "sources/academic.attention_heatmap/original.html#L45" }, { "line": 65, "end_line": 65, "code": "fig.colorbar(im, ax=ax_heat, shrink=0.6, label='Attention Weight', pad=0.12)", "href": "sources/academic.attention_heatmap/original.html#L65" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.radar", "display_name": "多数据集分组性能柱图", "tags": [ "比较", "误差" ], "purpose": "同一组模型在多个数据集上的表现怎样?", "data_requirements": [ "方法×数据集得分矩阵", "误差长度" ], "composition": "按数据集分组的并排柱", "visual_features": [ "每数据集内按得分变化的绿色深浅", "误差棒", "最优星号" ], "adaptation_notes": "原ID和标题称雷达图,但实际为柱图;色深映射数值,不能仅凭颜色图例识别方法。", "number": 72, "kind": "recipe", "legacy_title": "Architecture Comparison Radar — 架构对比雷达图", "legacy_ref": "academic #5", "source": { "original_code": "sources/academic.radar/original.py", "execution_code": "sources/academic.radar/render.py", "recipe_section": "sources/academic.radar/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "1b260b9208bd6d3ad36d30449f8642019dcbd5148aaf061fc9c6f38dc4df5eca", "code_sha256": "183797bf275930ef4cc5fddbb112f66c212cb78da478cc39771bff11074913e5", "execution_sha256": "d791b36d690565707543472d41a585f78d2a93765caf847fff2692df58282192", "code_view": "sources/academic.radar/original.html" }, "title_mismatch": true, "compatibility_patches": [ "RGB/RGBA 元组转十六进制以适配原 _lighten 接口,颜色含义不变" ], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.radar-1.png", "thumbnail": "thumbnails/academic.radar-1.jpg", "sha256": "dcd689fccf82308d2fe7d4bab2a8523b44263cffd2540318292493570ad99a82", "pixels": [ 1620, 900 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 27, "operation": "bar", "code": " bar = ax.bar(x[j] + offset, scores[i, j], width, yerr=stds[i, j], capsize=3, color=_lighten(color, 0.35), edgecolor=color, linewidth=1.0, error_kw={'elinewidth': 0.8, 'capthick': 0.6})" }, { "line": 41, "operation": "bar", "code": " ax.bar([], [], color=_lighten(PALETTE[i], 0.4), label=method, edgecolor=PALETTE[i], linewidth=1.2)" } ], "literal_colormaps": [ "YlGn" ], "aliases": [ "grouped benchmark bar", "跨数据集方法比较" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.radar.md", "fidelity_checkpoints": [ { "feature": "实际是分组得分柱", "preserve": "按这个 ID 的真实源码保留并排柱、数据驱动的绿色深浅、浅填充深边、误差棒与最优标记;不要按旧标题改画雷达。", "allowed_adaptation": "方法、数据集、连续色相和布局可变;误差来源与最优方向按当前数据确定。", "evidence": [ { "line": 27, "end_line": 29, "code": " bar = ax.bar(x[j] + offset, scores[i, j], width, yerr=stds[i, j], capsize=3,\n color=_lighten(color, 0.35), edgecolor=color, linewidth=1.0,\n error_kw={'elinewidth': 0.8, 'capthick': 0.6})", "href": "sources/academic.radar/original.html#L27" }, { "line": 34, "end_line": 37, "code": " ax.text(x[j] + offset, scores[i, j] + stds[i, j] + 0.4,\n f'{\"★\" if is_best else \"\"}{scores[i, j]:.1f}',\n ha='center', fontsize=7, fontweight='bold' if is_best else 'normal',\n color=COLORS['down'] if is_best else COLORS['text'])", "href": "sources/academic.radar/original.html#L34" }, { "line": 41, "end_line": 41, "code": " ax.bar([], [], color=_lighten(PALETTE[i], 0.4), label=method, edgecolor=PALETTE[i], linewidth=1.2)", "href": "sources/academic.radar/original.html#L41" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.hyperparameter_sensitivity", "display_name": "超参数性能四面板", "tags": [ "优化", "比较", "误差", "组合" ], "purpose": "多个超参数各自的优选范围在哪里?", "data_requirements": [ "每参数的取值网格", "表现均值、最小值和最大值" ], "composition": "2×2,每格一个超参数", "visual_features": [ "三层范围带", "上下边界虚线", "最佳点白环", "优选区域阴影" ], "adaptation_notes": "示例范围是min/max,非自动统计CI;横坐标按档位等距,需注意真实数值间距。", "number": 73, "kind": "recipe", "legacy_title": "Hyperparameter Sensitivity — 超参数灵敏度图", "legacy_ref": "academic #6", "source": { "original_code": "sources/academic.hyperparameter_sensitivity/original.py", "execution_code": "sources/academic.hyperparameter_sensitivity/render.py", "recipe_section": "sources/academic.hyperparameter_sensitivity/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "f14b885ba96a68173e2d41bc0c19982a09ffb401e2d714f652f40531e7d7b462", "code_sha256": "19d9d399387ea91cfeaf485818d75e268689f1319a7f8e7caadac28d28fa6be9", "execution_sha256": "19d9d399387ea91cfeaf485818d75e268689f1319a7f8e7caadac28d28fa6be9", "code_view": "sources/academic.hyperparameter_sensitivity/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.hyperparameter_sensitivity-1.png", "thumbnail": "thumbnails/academic.hyperparameter_sensitivity-1.jpg", "sha256": "8f5d6beb4d40b70bc4d34a4a3db75cba93a223acb246ece936ef928a2f7f52a2", "pixels": [ 900, 882 ], "native_inches": [ 5.0, 4.9 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 34, "operation": "fill_between", "code": " ax.fill_between(x_pos, np.array(y_min) + shrink, np.array(y_max) - shrink, alpha=alpha, color=PALETTE[idx], linewidth=0)" }, { "line": 40, "operation": "plot", "code": " ax.plot(x_pos, y_min, '--', color=PALETTE[idx], linewidth=0.8, alpha=0.4)" }, { "line": 41, "operation": "plot", "code": " ax.plot(x_pos, y_max, '--', color=PALETTE[idx], linewidth=0.8, alpha=0.4)" }, { "line": 44, "operation": "plot", "code": " ax.plot(x_pos, y_mean, 'o-', color=PALETTE[idx], linewidth=2, markersize=7, markeredgecolor='white', markeredgewidth=1.2)" }, { "line": 49, "operation": "scatter", "code": " ax.scatter(best_i, y_mean[best_i], s=150, color=PALETTE[idx], zorder=5, edgecolor='white', linewidth=2.5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.hyperparameter_sensitivity.md", "fidelity_checkpoints": [ { "feature": "四面板范围与最优环", "preserve": "保留三层范围带、上下边界虚线、均值线、最佳点白环和有依据的优选区域。", "allowed_adaptation": "超参数数目、类别或数值轴、范围及最优方向可变;从重复结果得到区间而非随机生成。", "evidence": [ { "line": 34, "end_line": 37, "code": " ax.fill_between(x_pos,\n np.array(y_min) + shrink,\n np.array(y_max) - shrink,\n alpha=alpha, color=PALETTE[idx], linewidth=0)", "href": "sources/academic.hyperparameter_sensitivity/original.html#L34" }, { "line": 40, "end_line": 40, "code": " ax.plot(x_pos, y_min, '--', color=PALETTE[idx], linewidth=0.8, alpha=0.4)", "href": "sources/academic.hyperparameter_sensitivity/original.html#L40" }, { "line": 41, "end_line": 41, "code": " ax.plot(x_pos, y_max, '--', color=PALETTE[idx], linewidth=0.8, alpha=0.4)", "href": "sources/academic.hyperparameter_sensitivity/original.html#L41" }, { "line": 44, "end_line": 45, "code": " ax.plot(x_pos, y_mean, 'o-', color=PALETTE[idx], linewidth=2, markersize=7,\n markeredgecolor='white', markeredgewidth=1.2)", "href": "sources/academic.hyperparameter_sensitivity/original.html#L44" }, { "line": 49, "end_line": 50, "code": " ax.scatter(best_i, y_mean[best_i], s=150, color=PALETTE[idx], zorder=5,\n edgecolor='white', linewidth=2.5)", "href": "sources/academic.hyperparameter_sensitivity/original.html#L49" }, { "line": 55, "end_line": 56, "code": " ax.axvspan(opt_left - 0.3, opt_right + 0.3, alpha=0.08, color=COLORS['up'],\n label='Optimal region')", "href": "sources/academic.hyperparameter_sensitivity/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.confusion_matrix", "display_name": "雨云分布与效应量显著性", "tags": [ "分布", "比较", "组合" ], "purpose": "模型重复结果的分布与差异强度如何?", "data_requirements": [ "各方法原始连续样本", "检验与效应量计算口径" ], "composition": "竖向半小提琴、箱线、抖动散点;顶部比较括号", "visual_features": [ "透明琴体", "均值标记", "p值和Cohen's d" ], "adaptation_notes": "原ID和标题称混淆矩阵,实际为雨云图;不是分类计数矩阵,不能从汇总准确率恢复分布。", "number": 74, "kind": "recipe", "legacy_title": "Confusion Matrix — 混淆矩阵", "legacy_ref": "academic #7", "source": { "original_code": "sources/academic.confusion_matrix/original.py", "execution_code": "sources/academic.confusion_matrix/render.py", "recipe_section": "sources/academic.confusion_matrix/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "b6802fab7fd26904b8360caf22e766c60c4b912d3987a6ed3a811992a5cf0659", "code_sha256": "1ba1fae06eeb27b36207fdab7964aa637e9e342b2671f010bb2538d6c6884a6f", "execution_sha256": "1ba1fae06eeb27b36207fdab7964aa637e9e342b2671f010bb2538d6c6884a6f", "code_view": "sources/academic.confusion_matrix/original.html" }, "title_mismatch": true, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.confusion_matrix-1.png", "thumbnail": "thumbnails/academic.confusion_matrix-1.jpg", "sha256": "2a863ae1a5dc5c8f7569e0819c6e73b8ccb152fabe16179fcd99bed45fd42bc0", "pixels": [ 1440, 720 ], "native_inches": [ 8.0, 4.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 32, "operation": "fill_betweenx", "code": " ax.fill_betweenx(yr, pos + frac * 0.02, pos + density_norm * (1 - frac * 0.12), alpha=alpha, color=PALETTE[i], linewidth=0)" }, { "line": 34, "operation": "plot", "code": " ax.plot(pos + density_norm, yr, color=PALETTE[i], linewidth=1.2, alpha=0.8)" }, { "line": 37, "operation": "boxplot", "code": " bp = ax.boxplot(d, positions=[pos - 0.18], widths=0.12, vert=True, patch_artist=True, boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4), edgecolor=PALETTE[i], linewidth=1.2), medianprops=dict(color=COLORS['text'], linewidth=1.8)," }, { "line": 47, "operation": "scatter", "code": " ax.scatter(pos - 0.38 + jitter, d, s=6, alpha=0.2, color=PALETTE[i], edgecolor='none')" }, { "line": 50, "operation": "scatter", "code": " ax.scatter(pos - 0.18, d.mean(), marker='D', s=45, color=PALETTE[i], edgecolor='white', linewidth=1.2, zorder=5)" }, { "line": 55, "operation": "plot", "code": " ax.plot([x1, x1, x2, x2], [y, y + h, y + h, y], color=COLORS['text'], linewidth=0.8)" } ], "literal_colormaps": [], "aliases": [ "raincloud", "效应量", "Cohen d", "半小提琴" ], "related_ids": [ "basic.raincloud", "basic.raincloud_violin", "advanced.grouped_violin", "advanced.ridgeline", "empirical.raincloud", "empirical.prediction_error_raincloud" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.confusion_matrix.md", "fidelity_checkpoints": [ { "feature": "实际是带检验的雨云", "preserve": "按真实源码保留分层半小提琴、左侧窄箱和散点、均值菱形及有统计依据的比较括号,不按旧标题画混淆矩阵。", "allowed_adaptation": "组数、间距、密度带宽可变;p 值和效应量由当前样本正确计算。", "evidence": [ { "line": 32, "end_line": 33, "code": " ax.fill_betweenx(yr, pos + frac * 0.02, pos + density_norm * (1 - frac * 0.12),\n alpha=alpha, color=PALETTE[i], linewidth=0)", "href": "sources/academic.confusion_matrix/original.html#L32" }, { "line": 34, "end_line": 34, "code": " ax.plot(pos + density_norm, yr, color=PALETTE[i], linewidth=1.2, alpha=0.8)", "href": "sources/academic.confusion_matrix/original.html#L34" }, { "line": 37, "end_line": 43, "code": " bp = ax.boxplot(d, positions=[pos - 0.18], widths=0.12, vert=True, patch_artist=True,\n boxprops=dict(facecolor=_lighten(PALETTE[i], 0.4),\n edgecolor=PALETTE[i], linewidth=1.2),\n medianprops=dict(color=COLORS['text'], linewidth=1.8),\n whiskerprops=dict(linewidth=1, color=PALETTE[i]),\n capprops=dict(linewidth=1, color=COLORS['ref_line']),\n flierprops=dict(marker='', markersize=0))", "href": "sources/academic.confusion_matrix/original.html#L37" }, { "line": 47, "end_line": 47, "code": " ax.scatter(pos - 0.38 + jitter, d, s=6, alpha=0.2, color=PALETTE[i], edgecolor='none')", "href": "sources/academic.confusion_matrix/original.html#L47" }, { "line": 50, "end_line": 51, "code": " ax.scatter(pos - 0.18, d.mean(), marker='D', s=45, color=PALETTE[i],\n edgecolor='white', linewidth=1.2, zorder=5)", "href": "sources/academic.confusion_matrix/original.html#L50" }, { "line": 55, "end_line": 55, "code": " ax.plot([x1, x1, x2, x2], [y, y + h, y + h, y], color=COLORS['text'], linewidth=0.8)", "href": "sources/academic.confusion_matrix/original.html#L55" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.feature_importance", "display_name": "三维损失地形与优化轨迹", "tags": [ "优化", "三维", "组合" ], "purpose": "优化路径如何穿越损失地形并到达低谷?", "data_requirements": [ "二维参数网格与目标值", "迭代路径及路径损失" ], "composition": "3D曲面;底部等高线;曲面上的轨迹", "visual_features": [ "红蓝曲面", "轨迹随步数变色", "起止与最优标记" ], "adaptation_notes": "原ID和标题称特征重要性,实际是损失曲面;地形与路径均为模拟,非SHAP结果。", "number": 75, "kind": "recipe", "legacy_title": "Feature Importance (SHAP-style) — 特征重要性", "legacy_ref": "academic #8", "source": { "original_code": "sources/academic.feature_importance/original.py", "execution_code": "sources/academic.feature_importance/render.py", "recipe_section": "sources/academic.feature_importance/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "abcdbe0063125fa12bd87426e77e935a4467f8c30a0c53bce96570313596de91", "code_sha256": "74da6c9e5e67f6dfd3a2bc5ef579c0028481fc897551a3578c3ef396fcdceb89", "execution_sha256": "74da6c9e5e67f6dfd3a2bc5ef579c0028481fc897551a3578c3ef396fcdceb89", "code_view": "sources/academic.feature_importance/original.html" }, "title_mismatch": true, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.feature_importance-1.png", "thumbnail": "thumbnails/academic.feature_importance-1.jpg", "sha256": "a085b0aeebd8d41be0621d1b9ae588b704f22e215aef30cd23a5a5041dc1eb01", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 14, "operation": "plot_surface", "code": "surf = ax.plot_surface(X, Y, Z, cmap='coolwarm', alpha=0.65, edgecolor='none', antialiased=True, rstride=2, cstride=2)" }, { "line": 18, "operation": "contour", "code": "ax.contour(X, Y, Z, zdir='z', offset=Z.min() - 0.5, cmap='coolwarm', alpha=0.3, levels=15)" }, { "line": 42, "operation": "plot", "code": " ax.plot(traj_x[k:k + 2], traj_y[k:k + 2], traj_z[k:k + 2], color=color, linewidth=1.5, alpha=0.8)" }, { "line": 46, "operation": "scatter", "code": "ax.scatter([traj_x[0]], [traj_y[0]], [traj_z[0]], color=COLORS['down'], s=80, marker='^', edgecolor='white', linewidth=1, zorder=6, label='Start')" }, { "line": 48, "operation": "scatter", "code": "ax.scatter([traj_x[-1]], [traj_y[-1]], [traj_z[-1]], color=COLORS['up'], s=80, marker='*', edgecolor='white', linewidth=1, zorder=6, label='End')" }, { "line": 52, "operation": "scatter", "code": "ax.scatter([0], [0], [Z.min()], color=COLORS['down'], s=120, marker='*', edgecolor='white', zorder=5, label='Global Min')" }, { "line": 59, "operation": "scatter", "code": " ax.scatter([sx], [sy], [sz], color=PALETTE[2], s=40, marker='o', edgecolor='white', zorder=5)" } ], "literal_colormaps": [ "coolwarm" ], "aliases": [ "loss landscape", "optimization trajectory", "损失地形" ], "related_ids": [ "competition.surface_3d", "competition.contour", "competition.feasible_region" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.feature_importance.md", "fidelity_checkpoints": [ { "feature": "实际是带轨迹的三维曲面", "preserve": "保留半透明曲面、底部投影、随步数变化颜色的路径及起止标记;不要只剩一张无轨迹曲面。", "allowed_adaptation": "网格、视角、连续色相可变;轨迹高度、起止和最优点重新计算,不复制示例的最优坐标。", "evidence": [ { "line": 14, "end_line": 15, "code": "surf = ax.plot_surface(X, Y, Z, cmap='coolwarm', alpha=0.65, edgecolor='none',\n antialiased=True, rstride=2, cstride=2)", "href": "sources/academic.feature_importance/original.html#L14" }, { "line": 18, "end_line": 18, "code": "ax.contour(X, Y, Z, zdir='z', offset=Z.min() - 0.5, cmap='coolwarm', alpha=0.3, levels=15)", "href": "sources/academic.feature_importance/original.html#L18" }, { "line": 42, "end_line": 43, "code": " ax.plot(traj_x[k:k + 2], traj_y[k:k + 2], traj_z[k:k + 2],\n color=color, linewidth=1.5, alpha=0.8)", "href": "sources/academic.feature_importance/original.html#L42" }, { "line": 46, "end_line": 47, "code": "ax.scatter([traj_x[0]], [traj_y[0]], [traj_z[0]], color=COLORS['down'], s=80,\n marker='^', edgecolor='white', linewidth=1, zorder=6, label='Start')", "href": "sources/academic.feature_importance/original.html#L46" }, { "line": 48, "end_line": 49, "code": "ax.scatter([traj_x[-1]], [traj_y[-1]], [traj_z[-1]], color=COLORS['up'], s=80,\n marker='*', edgecolor='white', linewidth=1, zorder=6, label='End')", "href": "sources/academic.feature_importance/original.html#L48" }, { "line": 52, "end_line": 53, "code": "ax.scatter([0], [0], [Z.min()], color=COLORS['down'], s=120, marker='*',\n edgecolor='white', zorder=5, label='Global Min')", "href": "sources/academic.feature_importance/original.html#L52" }, { "line": 59, "end_line": 60, "code": " ax.scatter([sx], [sy], [sz], color=PALETTE[2], s=40, marker='o',\n edgecolor='white', zorder=5)", "href": "sources/academic.feature_importance/original.html#L59" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.learning_rate", "display_name": "图像重建与误差多面板", "tags": [ "图像", "比较", "组合" ], "purpose": "各方法的重建细节与误差集中在哪些位置?", "data_requirements": [ "同一场景输入、参考图和各方法输出", "误差图", "评价指标" ], "composition": "场景行块×方法列;结果行与误差行交替", "visual_features": [ "局部框选", "方法列对齐", "误差热图", "指标标题" ], "adaptation_notes": "原ID和标题称学习率调度,实际为图像对比;示例图与指标是模拟,局部框不等于已放大视图。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 76, "kind": "recipe", "legacy_title": "Learning Rate Schedule — 学习率调度曲线", "legacy_ref": "academic #9", "source": { "original_code": "sources/academic.learning_rate/original.py", "execution_code": "sources/academic.learning_rate/render.py", "recipe_section": "sources/academic.learning_rate/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "659cc34d7339b37cf58c0527a15bb470a67529a8ee72554b12a3005396d10561", "code_sha256": "4531f6849b9853068c05c382f8e931920c1911ef0bd2c47cf75a4022e6a22704", "execution_sha256": "4531f6849b9853068c05c382f8e931920c1911ef0bd2c47cf75a4022e6a22704", "code_view": "sources/academic.learning_rate/original.html", "palette_binding": "project" }, "title_mismatch": true, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.learning_rate-1.png", "thumbnail": "thumbnails/academic.learning_rate-1.jpg", "sha256": "ed8b457084e57ccecb6d50675f969fef1ff6d50fc499a4f04bca4050b940b0b2", "pixels": [ 2879, 1788 ], "native_inches": [ 13.0, 8.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 35, "operation": "imshow", "code": "ax.imshow(img)" }, { "line": 42, "operation": "add_patch", "code": "ax.add_patch(rect)" }, { "line": 62, "operation": "imshow", "code": "ax_err.imshow(error, cmap=palette_cmap('sequential'), vmin=0, vmax=0.5)" } ], "literal_colormaps": [], "aliases": [ "reconstruction comparison", "error maps", "图像重建比较" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.learning_rate.md", "fidelity_checkpoints": [ { "feature": "实际是图像与误差矩阵", "preserve": "保留场景行块、方法列、结果与误差行交替,以及局部框选;对应图像位置应对齐。", "allowed_adaptation": "方法与场景数量、图像尺寸可变;误差尺度在可比面板一致,框选来自真实相同区域。", "evidence": [ { "line": 35, "end_line": 35, "code": " ax.imshow(img)", "href": "sources/academic.learning_rate/original.html#L35" }, { "line": 40, "end_line": 41, "code": " rect = Rectangle((10, 10), 20, 20, linewidth=1.5, edgecolor=COLORS['down'],\n facecolor='none', linestyle='-')", "href": "sources/academic.learning_rate/original.html#L40" }, { "line": 62, "end_line": 62, "code": " ax_err.imshow(error, cmap=palette_cmap('sequential'), vmin=0, vmax=0.5)", "href": "sources/academic.learning_rate/original.html#L62" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.latent_interpolation", "display_name": "归一化多指标雷达对比", "tags": [ "比较", "多维" ], "purpose": "不同方法的能力轮廓与短板怎样?", "data_requirements": [ "方法×归一化指标", "指标顺序及高低优方向" ], "composition": "极坐标闭合多边形叠加", "visual_features": [ "透明面填充", "阈值环", "主方法数值", "中心面积摘要" ], "adaptation_notes": "原ID和标题称隐空间插值,实际是雷达图;面积随指标顺序变化,不宜作为独立严谨综合分。", "number": 77, "kind": "recipe", "legacy_title": "Latent Space Interpolation — 隐空间插值", "legacy_ref": "academic #10", "source": { "original_code": "sources/academic.latent_interpolation/original.py", "execution_code": "sources/academic.latent_interpolation/render.py", "recipe_section": "sources/academic.latent_interpolation/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "e6e70444611d6893578f435d91450d098a1fc709ceabc73c53c16c12bb8d6c95", "code_sha256": "685d752691278292fc25e6f31d1f86c28ff7ff280519de97a63f8131eb57cdda", "execution_sha256": "685d752691278292fc25e6f31d1f86c28ff7ff280519de97a63f8131eb57cdda", "code_view": "sources/academic.latent_interpolation/original.html" }, "title_mismatch": true, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.latent_interpolation-1.png", "thumbnail": "thumbnails/academic.latent_interpolation-1.jpg", "sha256": "2348e8be14ce2804d2800d42d74f16b3dfc2dcd8930f331f1a84152984ac7620", "pixels": [ 1170, 1080 ], "native_inches": [ 6.5, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 29, "operation": "plot", "code": "ax.plot(angles, [threshold] * (N + 1), '--', color=COLORS['ref_line'], linewidth=1, alpha=0.4)" }, { "line": 38, "operation": "plot", "code": " ax.plot(angles, vc, 'o-', linewidth=lw, markersize=5, color=PALETTE[i], label=name, markeredgecolor='white', markeredgewidth=0.8)" }, { "line": 40, "operation": "fill", "code": " ax.fill(angles, vc, alpha=alpha_fill, color=PALETTE[i])" } ], "literal_colormaps": [], "aliases": [ "radar", "雷达图", "能力轮廓" ], "related_ids": [ "competition.radar", "advanced.parallel_coordinates", "advanced.method_heatmap", "empirical.prediction_accuracy_heatmap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.latent_interpolation.md", "fidelity_checkpoints": [ { "feature": "实际是透明雷达叠面", "preserve": "保留闭合多边形的透明叠加、阈值环和主方法数值,不压成只有轮廓的雷达线。", "allowed_adaptation": "指标数、量纲归一化和主方法可变;阈值及面积摘要需有明确解释。", "evidence": [ { "line": 29, "end_line": 29, "code": "ax.plot(angles, [threshold] * (N + 1), '--', color=COLORS['ref_line'], linewidth=1, alpha=0.4)", "href": "sources/academic.latent_interpolation/original.html#L29" }, { "line": 30, "end_line": 31, "code": "ax.text(0.02, 0.02, f'Baseline ({threshold})', fontsize=7, color=COLORS['ref_line'],\n transform=ax.transAxes, ha='left', va='bottom')", "href": "sources/academic.latent_interpolation/original.html#L30" }, { "line": 38, "end_line": 39, "code": " ax.plot(angles, vc, 'o-', linewidth=lw, markersize=5, color=PALETTE[i], label=name,\n markeredgecolor='white', markeredgewidth=0.8)", "href": "sources/academic.latent_interpolation/original.html#L38" }, { "line": 40, "end_line": 40, "code": " ax.fill(angles, vc, alpha=alpha_fill, color=PALETTE[i])", "href": "sources/academic.latent_interpolation/original.html#L40" }, { "line": 46, "end_line": 49, "code": " ax.text(ang, val + offset_r, f'{val:.2f}', fontsize=7, ha='center', va='bottom',\n color=PALETTE[i], fontweight='bold',\n bbox=dict(boxstyle='round,pad=0.15', facecolor='white',\n edgecolor=PALETTE[i], alpha=0.85, linewidth=0.4))", "href": "sources/academic.latent_interpolation/original.html#L46" }, { "line": 56, "end_line": 60, "code": "ax.text(0, 0, f'Area ratio\\nvs Ours:\\n' + '\\n'.join(ratios),\n ha='center', va='center', fontsize=7, color=COLORS['text'],\n transform=ax.transData,\n bbox=dict(boxstyle='round,pad=0.4', facecolor='white',\n edgecolor=COLORS['grid'], alpha=0.9))", "href": "sources/academic.latent_interpolation/original.html#L56" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.benchmark_table", "display_name": "三维分组点云与凸包投影", "tags": [ "三维", "聚类", "组合" ], "purpose": "三维特征中的类别分离与包络怎样?", "data_requirements": [ "三维坐标和组标签" ], "composition": "3D分组散点;透明凸包与平面投影", "visual_features": [ "半透明空间包络", "细点云", "投影辅助空间理解" ], "adaptation_notes": "原ID和标题称基准表,实际为3D簇;凸包非置信域;退化共面数据可能不适合凸包。", "number": 78, "kind": "recipe", "legacy_title": "Multi-Dataset Benchmark Table — 多数据集基准表", "legacy_ref": "academic #11", "source": { "original_code": "sources/academic.benchmark_table/original.py", "execution_code": "sources/academic.benchmark_table/render.py", "recipe_section": "sources/academic.benchmark_table/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "33fd75aa34a2df48213e2ebdcee3ab363a884818b10ccd4ea2856aa4a6b70f19", "code_sha256": "77a5e449821a4ac1e919183400f5fff02c21da0fc59a2e3b6bb72fd1b4a9a7d0", "execution_sha256": "77a5e449821a4ac1e919183400f5fff02c21da0fc59a2e3b6bb72fd1b4a9a7d0", "code_view": "sources/academic.benchmark_table/original.html" }, "title_mismatch": true, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.benchmark_table-1.png", "thumbnail": "thumbnails/academic.benchmark_table-1.jpg", "sha256": "b883c482001f6ef1489f94cdeffa0ed007d746e8dbab7560e649b1df8efe9662", "pixels": [ 1440, 1260 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 24, "operation": "scatter", "code": " ax.scatter(pts[:, 0], pts[:, 1], pts[:, 2], s=12, alpha=0.4, color=PALETTE[i], label=cls, edgecolor='none')" }, { "line": 43, "operation": "scatter", "code": " ax.scatter(pts[:, 0], pts[:, 1], np.full(len(pts), all_pts_arr[:, 2].min() - 1.5), s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')" }, { "line": 46, "operation": "scatter", "code": " ax.scatter(pts[:, 0], np.full(len(pts), all_pts_arr[:, 1].max() + 1.5), pts[:, 2], s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')" }, { "line": 49, "operation": "scatter", "code": " ax.scatter(np.full(len(pts), all_pts_arr[:, 0].min() - 1.5), pts[:, 1], pts[:, 2], s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')" } ], "literal_colormaps": [], "aliases": [ "3d clusters", "convex hull", "三维凸包" ], "related_ids": [ "competition.cluster_3d", "academic.tsne_umap", "competition.kmeans" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.benchmark_table.md", "fidelity_checkpoints": [ { "feature": "实际是三维点云与凸包", "preserve": "保留小透明点、alpha=0.08 空间凸包与三个平面的浅投影,不简化成普通三维散点。", "allowed_adaptation": "组数、凸包、投影偏移及视角由真实数据适配;退化凸包允许省略并说明。", "evidence": [ { "line": 24, "end_line": 25, "code": " ax.scatter(pts[:, 0], pts[:, 1], pts[:, 2], s=12, alpha=0.4,\n color=PALETTE[i], label=cls, edgecolor='none')", "href": "sources/academic.benchmark_table/original.html#L24" }, { "line": 34, "end_line": 35, "code": " poly = Poly3DCollection(faces, alpha=0.08, facecolor=PALETTE[i],\n edgecolor=PALETTE[i], linewidth=0.3)", "href": "sources/academic.benchmark_table/original.html#L34" }, { "line": 43, "end_line": 44, "code": " ax.scatter(pts[:, 0], pts[:, 1], np.full(len(pts), all_pts_arr[:, 2].min() - 1.5),\n s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')", "href": "sources/academic.benchmark_table/original.html#L43" }, { "line": 46, "end_line": 47, "code": " ax.scatter(pts[:, 0], np.full(len(pts), all_pts_arr[:, 1].max() + 1.5), pts[:, 2],\n s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')", "href": "sources/academic.benchmark_table/original.html#L46" }, { "line": 49, "end_line": 50, "code": " ax.scatter(np.full(len(pts), all_pts_arr[:, 0].min() - 1.5), pts[:, 1], pts[:, 2],\n s=3, alpha=0.1, color=PALETTE[i], edgecolor='none')", "href": "sources/academic.benchmark_table/original.html#L49" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "academic.error_analysis", "display_name": "精度成本气泡与Pareto比较", "tags": [ "比较", "优化", "多维" ], "purpose": "模型精度、算力与参数量如何权衡?", "data_requirements": [ "各模型计算成本、准确率、参数量、名称" ], "composition": "成本—精度散点;气泡大小编码参数量", "visual_features": [ "主模型外环", "等效率参考线", "Pareto连线", "大小图例" ], "adaptation_notes": "实际不是误差分布;原三次样条Pareto连线明显下凹,不能视为真实可达前沿;左上标签较密。", "number": 79, "kind": "recipe", "legacy_title": "Error Analysis — 错误分析图", "legacy_ref": "academic #12", "source": { "original_code": "sources/academic.error_analysis/original.py", "execution_code": "sources/academic.error_analysis/render.py", "recipe_section": "sources/academic.error_analysis/recipe.md", "recipe_file": "figure_recipes_academic.md", "content_sha256": "9da56de41f54bb43bebcafb66320d5d24f8279720152eb7a7d2659d2e29ef49a", "code_sha256": "05c5d4cbc125692c4b359eb1e939351c7f8865406f4dce4223fba9c5bd284404", "execution_sha256": "05c5d4cbc125692c4b359eb1e939351c7f8865406f4dce4223fba9c5bd284404", "code_view": "sources/academic.error_analysis/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/academic.error_analysis-1.png", "thumbnail": "thumbnails/academic.error_analysis-1.jpg", "sha256": "7dcee036bc3709ed922df82355347037ee1cfa3781c5f6974c5783566e08a138", "pixels": [ 1440, 990 ], "native_inches": [ 8.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 19, "operation": "plot", "code": " ax.plot(flops_grid[mask], acc_iso[mask], '-', color=COLORS['grid'], linewidth=0.6, alpha=0.5)" }, { "line": 27, "operation": "scatter", "code": " ax.scatter(flops[i], acc[i], s=s, color=c, alpha=alpha, edgecolor='white', linewidth=1, zorder=3)" }, { "line": 36, "operation": "scatter", "code": "ax.scatter(flops[ours_idx], acc[ours_idx], s=params[ours_idx] * 3 + 120, facecolor='none', edgecolor=PALETTE[0], linewidth=2.5, zorder=4)" }, { "line": 61, "operation": "plot", "code": " ax.plot(f_smooth, a_smooth, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6, label='Pareto frontier')" }, { "line": 64, "operation": "plot", "code": " ax.plot(pareto_flops, pareto_acc, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6, label='Pareto frontier')" }, { "line": 67, "operation": "plot", "code": " ax.plot(pareto_flops, pareto_acc, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6, label='Pareto frontier')" }, { "line": 78, "operation": "scatter", "code": " ax.scatter([], [], s=ps * 3, color=COLORS['ref_line'], alpha=0.3, edgecolor='white', label=f'{ps}M params')" } ], "literal_colormaps": [], "aliases": [ "accuracy efficiency tradeoff", "Pareto bubbles", "精度成本权衡" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/academic.error_analysis.md", "fidelity_checkpoints": [ { "feature": "气泡、外环与效率前沿", "preserve": "保留参数量映射气泡大小、重点模型外环、参考效率线与前沿;不要全点同大或删掉外环。", "allowed_adaptation": "成本、精度、参数规模、Pareto 集重算,连续连接不得伪造可达中间解。", "evidence": [ { "line": 19, "end_line": 19, "code": " ax.plot(flops_grid[mask], acc_iso[mask], '-', color=COLORS['grid'], linewidth=0.6, alpha=0.5)", "href": "sources/academic.error_analysis/original.html#L19" }, { "line": 27, "end_line": 28, "code": " ax.scatter(flops[i], acc[i], s=s, color=c, alpha=alpha, edgecolor='white',\n linewidth=1, zorder=3)", "href": "sources/academic.error_analysis/original.html#L27" }, { "line": 36, "end_line": 37, "code": "ax.scatter(flops[ours_idx], acc[ours_idx], s=params[ours_idx] * 3 + 120, facecolor='none',\n edgecolor=PALETTE[0], linewidth=2.5, zorder=4)", "href": "sources/academic.error_analysis/original.html#L36" }, { "line": 61, "end_line": 62, "code": " ax.plot(f_smooth, a_smooth, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6,\n label='Pareto frontier')", "href": "sources/academic.error_analysis/original.html#L61" }, { "line": 64, "end_line": 65, "code": " ax.plot(pareto_flops, pareto_acc, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6,\n label='Pareto frontier')", "href": "sources/academic.error_analysis/original.html#L64" }, { "line": 67, "end_line": 68, "code": " ax.plot(pareto_flops, pareto_acc, '-', color=PALETTE[0], linewidth=1.5, alpha=0.6,\n label='Pareto frontier')", "href": "sources/academic.error_analysis/original.html#L67" }, { "line": 78, "end_line": 78, "code": " ax.scatter([], [], s=ps * 3, color=COLORS['ref_line'], alpha=0.3, edgecolor='white', label=f'{ps}M params')", "href": "sources/academic.error_analysis/original.html#L78" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.convergence", "display_name": "多算法迭代收敛曲线", "tags": [ "优化", "趋势", "比较" ], "purpose": "算法收敛速度及最终目标值怎样?", "data_requirements": [ "各算法迭代序列与目标值" ], "composition": "多折线单面板;终点标签", "visual_features": [ "主算法加粗", "主曲线下浅填充", "收敛位置箭头" ], "adaptation_notes": "示例迭代为模拟曲线;阴影是强调,不是重复试验CI;收敛标准需按任务定义。", "number": 80, "kind": "recipe", "legacy_title": "收敛曲线对比图", "legacy_ref": "competition #1", "source": { "original_code": "sources/competition.convergence/original.py", "execution_code": "sources/competition.convergence/render.py", "recipe_section": "sources/competition.convergence/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "174dabfc89935a8e3b09853c6c7219f575f59a75349d7a5234fcca1e447a1721", "code_sha256": "5d04c19f827052e9e16b4de6635855c71774367f018b1f4caabfcb48a413f3f4", "execution_sha256": "5d04c19f827052e9e16b4de6635855c71774367f018b1f4caabfcb48a413f3f4", "code_view": "sources/competition.convergence/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.convergence-1.png", "thumbnail": "thumbnails/competition.convergence-1.jpg", "sha256": "98775b66061a50c74fa120bbefa1309090ed7cf33504e08368f9150f85ad57c9", "pixels": [ 1260, 810 ], "native_inches": [ 7.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "plot", "code": " ax.plot(iters, vals, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha, zorder=3)" }, { "line": 32, "operation": "fill_between", "code": "ax.fill_between(iters, ours, alpha=0.10, color=PALETTE[highlight_index], linewidth=0, zorder=1)" }, { "line": 41, "operation": "scatter", "code": "ax.scatter([iters[conv_idx]], [ours[conv_idx]], color=COLORS['down'], s=50, zorder=5, edgecolors='white')" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.performance_profile", "academic.training_curves" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.convergence.md", "fidelity_checkpoints": [ { "feature": "主曲线浅填充与收敛标记", "preserve": "保留主算法加粗、曲线下浅填充、终点标签和有依据的收敛位置箭头,不能只画等粗裸线。", "allowed_adaptation": "迭代次数、目标值与收敛判据按实际优化过程更新;曲线下填充不是不确定性区间。", "evidence": [ { "line": 23, "end_line": 23, "code": " ax.plot(iters, vals, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha, zorder=3)", "href": "sources/competition.convergence/original.html#L23" }, { "line": 32, "end_line": 32, "code": "ax.fill_between(iters, ours, alpha=0.10, color=PALETTE[highlight_index], linewidth=0, zorder=1)", "href": "sources/competition.convergence/original.html#L32" }, { "line": 37, "end_line": 40, "code": "ax.annotate('收敛点', xy=(iters[conv_idx], ours[conv_idx]),\n xytext=(iters[conv_idx]+60, ours[conv_idx]+12),\n fontsize=10, color=COLORS['down'], fontweight='bold',\n arrowprops=dict(arrowstyle='->', color=COLORS['down'], lw=1.5), zorder=5)", "href": "sources/competition.convergence/original.html#L37" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.tornado", "display_name": "参数上下扰动龙卷风图", "tags": [ "优化", "比较", "变化" ], "purpose": "哪些参数的扰动对结果影响最大?", "data_requirements": [ "各参数低值和高值扰动相对基准的影响" ], "composition": "按影响跨度排序的正负横条", "visual_features": [ "两方向配色", "随幅度变化的浅填充", "交替行底色" ], "adaptation_notes": "各参数扰动范围要可比;一侧影响不一定均为正或负,应以真实符号绘制。", "number": 81, "kind": "recipe", "legacy_title": "灵敏度图(Tornado / Sensitivity)", "legacy_ref": "competition #2", "source": { "original_code": "sources/competition.tornado/original.py", "execution_code": "sources/competition.tornado/render.py", "recipe_section": "sources/competition.tornado/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "0d4bdcc61912f7c416ad06039b3fc6e2eddc1a6ec6a0901c68a15940a2e88a27", "code_sha256": "d9a73252033c7f240c28617aedb6d1f4a755397f5f531632a92dd688450857f8", "execution_sha256": "d9a73252033c7f240c28617aedb6d1f4a755397f5f531632a92dd688450857f8", "code_view": "sources/competition.tornado/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.tornado-1.png", "thumbnail": "thumbnails/competition.tornado-1.jpg", "sha256": "895902ef156e68de69943592cf56952b8a4034292428dcd3a50afcd0be418d43", "pixels": [ 1440, 972 ], "native_inches": [ 8.0, 5.3999999999999995 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 44, "operation": "barh", "code": " ax.barh(y[i], high_impact[i], height=0.52, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)" }, { "line": 48, "operation": "barh", "code": " ax.barh(y[i], low_impact[i], height=0.52, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)" }, { "line": 53, "operation": "plot", "code": " ax.plot([low_impact[i], high_impact[i]], [y[i], y[i]], color=COLORS['ref_line'], linewidth=0.5, zorder=1, alpha=0.4)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.tornado.md", "fidelity_checkpoints": [ { "feature": "双向幅度与浅深映射", "preserve": "保留按影响跨度排序的两向条形、随幅度变化的浅填色和深描边,以及浅交替行。", "allowed_adaptation": "正负扰动和影响幅度据实计算,可调条宽和文本间距,不能固定所有条的深浅。", "evidence": [ { "line": 34, "end_line": 34, "code": " ax.axhspan(y[i] - 0.4, y[i] + 0.4, alpha=0.03, color=PALETTE[0], zorder=0)", "href": "sources/competition.tornado/original.html#L34" }, { "line": 44, "end_line": 45, "code": " ax.barh(y[i], high_impact[i], height=0.52,\n color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)", "href": "sources/competition.tornado/original.html#L44" }, { "line": 48, "end_line": 49, "code": " ax.barh(y[i], low_impact[i], height=0.52,\n color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)", "href": "sources/competition.tornado/original.html#L48" }, { "line": 59, "end_line": 61, "code": " ax.text(high_impact[i] + margin, y[i], f'+{high_impact[i]:.1f}%',\n va='center', ha='left', fontsize=8.5, fontweight='bold',\n color=_lighten(color_pos, lighten_amt * 0.5))", "href": "sources/competition.tornado/original.html#L59" }, { "line": 63, "end_line": 65, "code": " ax.text(low_impact[i] - margin, y[i], f'{low_impact[i]:.1f}%',\n va='center', ha='right', fontsize=8.5, fontweight='bold',\n color=_lighten(color_neg, lighten_amt * 0.5))", "href": "sources/competition.tornado/original.html#L63" }, { "line": 69, "end_line": 72, "code": "ax.text(0, n - 0.1, '基准值', ha='center', va='bottom', fontsize=8,\n color=COLORS['ref_line'],\n bbox=dict(boxstyle='round,pad=0.2', facecolor='white',\n edgecolor=COLORS['grid'], alpha=0.85))", "href": "sources/competition.tornado/original.html#L69" }, { "line": 75, "end_line": 76, "code": "ax.text(max_abs * 0.6, -0.7, '参数增大 →', fontsize=8, color=color_pos,\n ha='center', fontstyle='italic', alpha=0.6)", "href": "sources/competition.tornado/original.html#L75" }, { "line": 77, "end_line": 78, "code": "ax.text(-max_abs * 0.6, -0.7, '← 参数减小', fontsize=8, color=color_neg,\n ha='center', fontstyle='italic', alpha=0.6)", "href": "sources/competition.tornado/original.html#L77" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.pareto_front", "display_name": "双目标Pareto前沿与代表解", "tags": [ "优化", "比较" ], "purpose": "两个冲突目标怎样权衡,折中解在哪里?", "data_requirements": [ "已筛选非支配解", "目标方向", "可选可行域和代表解" ], "composition": "二维前沿线;一侧区域填充", "visual_features": [ "极端解与折中星号", "方向箭头", "区域标签" ], "adaptation_notes": "示例前沿及可行域为解析演示;不能仅凭一条前沿把一侧全判为可行。", "number": 82, "kind": "recipe", "legacy_title": "Pareto 前沿图", "legacy_ref": "competition #3", "source": { "original_code": "sources/competition.pareto_front/original.py", "execution_code": "sources/competition.pareto_front/render.py", "recipe_section": "sources/competition.pareto_front/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "ffd3fadfe97c57acc05d1b0ec892d111290b21a2a66a4d448a84c0c61198d6fd", "code_sha256": "9112652d251af2ea92d1ff7c905ab1eafd6586959bdfb39c92da21491141d1c5", "execution_sha256": "9112652d251af2ea92d1ff7c905ab1eafd6586959bdfb39c92da21491141d1c5", "code_view": "sources/competition.pareto_front/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.pareto_front-1.png", "thumbnail": "thumbnails/competition.pareto_front-1.jpg", "sha256": "8df3d0d657281f2630e87fcdb1401de61096fa50052ded301c475fab39e4d996", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 14, "operation": "fill_between", "code": "ax.fill_between(pareto_f1, pareto_f2, 5.5, alpha=0.12, color=PALETTE[0], zorder=0)" }, { "line": 19, "operation": "plot", "code": "ax.plot(pareto_f1, pareto_f2, '-', color=COLORS['text'], linewidth=3, zorder=5, label='Pareto 最优前沿')" }, { "line": 23, "operation": "scatter", "code": "ax.scatter(pareto_f1[0], pareto_f2[0], marker='s', s=150, color=COLORS['up'], edgecolor='white', linewidth=1.5, zorder=6)" }, { "line": 35, "operation": "scatter", "code": "ax.scatter(pareto_f1[knee_idx], pareto_f2[knee_idx], marker='*', s=300, color=COLORS['highlight'], edgecolor='white', linewidth=1.5, zorder=6)" }, { "line": 46, "operation": "scatter", "code": "ax.scatter(pareto_f1[-1], pareto_f2[-1], marker='D', s=120, color=COLORS['down'], edgecolor='white', linewidth=1.5, zorder=6)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.pareto_front.md", "fidelity_checkpoints": [ { "feature": "前沿与代表解的视觉层次", "preserve": "保留前沿粗线、极端解与折中星号、短引线注释及方向箭头;区域浅填充仅在区域含义有数据或模型依据时保留。", "allowed_adaptation": "目标方向、实际前沿和折中判据按真实结果计算。离散候选只证明观测点的非支配关系;不能将平滑或直线插值的一侧声称为可行域。若展示离散最小化点集的支配区域,应按实际点构成的阶梯边界绘制;不需区域时省略对应填充与标签,保留前沿和代表解。", "evidence": [ { "line": 14, "end_line": 14, "code": "ax.fill_between(pareto_f1, pareto_f2, 5.5, alpha=0.12, color=PALETTE[0], zorder=0)", "href": "sources/competition.pareto_front/original.html#L14" }, { "line": 19, "end_line": 19, "code": "ax.plot(pareto_f1, pareto_f2, '-', color=COLORS['text'], linewidth=3, zorder=5, label='Pareto 最优前沿')", "href": "sources/competition.pareto_front/original.html#L19" }, { "line": 23, "end_line": 24, "code": "ax.scatter(pareto_f1[0], pareto_f2[0], marker='s', s=150, color=COLORS['up'],\n edgecolor='white', linewidth=1.5, zorder=6)", "href": "sources/competition.pareto_front/original.html#L23" }, { "line": 25, "end_line": 31, "code": "ax.annotate('缺水最小极端解\\n(min$G_t$,$Z_1$ 最小)',\n xy=(pareto_f1[0], pareto_f2[0]),\n xytext=(pareto_f1[0] + 0.3, pareto_f2[0] + 0.3),\n fontsize=8.5, color=COLORS['up'], fontweight='bold',\n arrowprops=dict(arrowstyle='->', color=COLORS['up'], lw=1.2),\n bbox=dict(boxstyle='round,pad=0.4', facecolor='white',\n edgecolor=COLORS['up'], alpha=0.9))", "href": "sources/competition.pareto_front/original.html#L25" }, { "line": 35, "end_line": 36, "code": "ax.scatter(pareto_f1[knee_idx], pareto_f2[knee_idx], marker='*', s=300,\n color=COLORS['highlight'], edgecolor='white', linewidth=1.5, zorder=6)", "href": "sources/competition.pareto_front/original.html#L35" }, { "line": 37, "end_line": 43, "code": "ax.annotate('均衡折中解(膝点)\\n$\\\\omega_1 Z_1 + \\\\omega_2 G_t$ 最优',\n xy=(pareto_f1[knee_idx], pareto_f2[knee_idx]),\n xytext=(pareto_f1[knee_idx] + 0.5, pareto_f2[knee_idx] + 0.6),\n fontsize=8.5, color=COLORS['highlight'], fontweight='bold',\n arrowprops=dict(arrowstyle='->', color=COLORS['highlight'], lw=1.2),\n bbox=dict(boxstyle='round,pad=0.4', facecolor='white',\n edgecolor=COLORS['highlight'], alpha=0.9))", "href": "sources/competition.pareto_front/original.html#L37" }, { "line": 46, "end_line": 47, "code": "ax.scatter(pareto_f1[-1], pareto_f2[-1], marker='D', s=120, color=COLORS['down'],\n edgecolor='white', linewidth=1.5, zorder=6)", "href": "sources/competition.pareto_front/original.html#L46" }, { "line": 48, "end_line": 54, "code": "ax.annotate('产量最大化极端解\\n(max$Z_1$,$G_t$ 较大)',\n xy=(pareto_f1[-1], pareto_f2[-1]),\n xytext=(pareto_f1[-1] - 1.5, pareto_f2[-1] - 0.5),\n fontsize=8.5, color=COLORS['down'], fontweight='bold',\n arrowprops=dict(arrowstyle='->', color=COLORS['down'], lw=1.2),\n bbox=dict(boxstyle='round,pad=0.4', facecolor='white',\n edgecolor=COLORS['down'], alpha=0.9))", "href": "sources/competition.pareto_front/original.html#L48" }, { "line": 57, "end_line": 58, "code": "ax.annotate('', xy=(2.0, 0.15), xytext=(0.5, 0.15),\n arrowprops=dict(arrowstyle='->', color=COLORS['ref_line'], lw=1.2, linestyle='--'))", "href": "sources/competition.pareto_front/original.html#L57" }, { "line": 60, "end_line": 61, "code": "ax.annotate('', xy=(0.3, 1.8), xytext=(0.3, 0.5),\n arrowprops=dict(arrowstyle='->', color=COLORS['ref_line'], lw=1.2, linestyle='--'))", "href": "sources/competition.pareto_front/original.html#L60" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.prediction_actual", "display_name": "预测对实际散点与下方残差分布", "tags": [ "预测", "误差", "组合" ], "purpose": "预测是否贴近真实值,残差是否偏斜?", "data_requirements": [ "逐样本真实值与预测值" ], "composition": "上方真实—预测散点;下方残差直方", "visual_features": [ "密度背景", "理想线", "拟合指标", "残差正态参考" ], "adaptation_notes": "上方横轴不是时间;下方分布是残差而非边际分布;比较需使用同一测试集。", "number": 83, "kind": "recipe", "legacy_title": "预测值 vs 实际值(上下放大 + 残差分布图)", "legacy_ref": "competition #4", "source": { "original_code": "sources/competition.prediction_actual/original.py", "execution_code": "sources/competition.prediction_actual/render.py", "recipe_section": "sources/competition.prediction_actual/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "ddc260e54708f1e6bf96248deaa3c557b28d096d664aef477ace7c5560368861", "code_sha256": "dec062e6b433b8192f15399bdfc754a5bbcceddcade695906dc9ecd35bb35ca6", "execution_sha256": "dec062e6b433b8192f15399bdfc754a5bbcceddcade695906dc9ecd35bb35ca6", "code_view": "sources/competition.prediction_actual/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.prediction_actual-1.png", "thumbnail": "thumbnails/competition.prediction_actual-1.jpg", "sha256": "a9c12182ccde49366e5eb4921f63cad0dc11ad526ecc02e37e511a6e280f48e0", "pixels": [ 1080, 1260 ], "native_inches": [ 6.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "contourf", "code": "ax1.contourf(Xg, Yg, Zg, levels=8, cmap='Blues', alpha=0.2, zorder=0)" }, { "line": 21, "operation": "scatter", "code": "ax1.scatter(actual, predicted, s=18, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.3, zorder=2)" }, { "line": 22, "operation": "plot", "code": "ax1.plot([5,105],[5,105], '--', color=COLORS['down'], linewidth=1.2, label='完美拟合线', zorder=3)" }, { "line": 23, "operation": "fill_between", "code": "ax1.fill_between([5,105],[0,100],[10,110], alpha=0.06, color=PALETTE[0])" }, { "line": 31, "operation": "hist", "code": "ax2.hist(residuals, bins=25, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8)" }, { "line": 33, "operation": "plot", "code": "ax2.plot(xr, norm.pdf(xr, residuals.mean(), residuals.std()), color=PALETTE[1], linewidth=2, label='正态拟合')" } ], "literal_colormaps": [ "Blues" ], "aliases": [], "related_ids": [ "advanced.fan", "empirical.prediction_ci", "advanced.calibration" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.prediction_actual.md", "fidelity_checkpoints": [ { "feature": "预测散点与下方误差", "preserve": "保留浅密度背景、透明白边散点、理想对角线及下方残差直方/正态参考,不仅保留拟合指标。", "allowed_adaptation": "真实和预测值配对,残差与指标重算;对角线周围区域须说明含义,不当成已计算 CI。", "evidence": [ { "line": 20, "end_line": 20, "code": "ax1.contourf(Xg, Yg, Zg, levels=8, cmap='Blues', alpha=0.2, zorder=0)", "href": "sources/competition.prediction_actual/original.html#L20" }, { "line": 21, "end_line": 21, "code": "ax1.scatter(actual, predicted, s=18, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.3, zorder=2)", "href": "sources/competition.prediction_actual/original.html#L21" }, { "line": 22, "end_line": 22, "code": "ax1.plot([5,105],[5,105], '--', color=COLORS['down'], linewidth=1.2, label='完美拟合线', zorder=3)", "href": "sources/competition.prediction_actual/original.html#L22" }, { "line": 23, "end_line": 23, "code": "ax1.fill_between([5,105],[0,100],[10,110], alpha=0.06, color=PALETTE[0])", "href": "sources/competition.prediction_actual/original.html#L23" }, { "line": 31, "end_line": 31, "code": "ax2.hist(residuals, bins=25, density=True, color=_lighten(PALETTE[0], 0.4), alpha=0.5, edgecolor=PALETTE[0], linewidth=0.8)", "href": "sources/competition.prediction_actual/original.html#L31" }, { "line": 33, "end_line": 33, "code": "ax2.plot(xr, norm.pdf(xr, residuals.mean(), residuals.std()), color=PALETTE[1], linewidth=2, label='正态拟合')", "href": "sources/competition.prediction_actual/original.html#L33" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.radar", "display_name": "多方案雷达与交替背景环", "tags": [ "比较", "多维" ], "purpose": "方案在各维度的长短板怎样分布?", "data_requirements": [ "方案×归一化指标", "标签与高低优方向" ], "composition": "极坐标闭合多边形", "visual_features": [ "透明叠加面", "主方案突出", "交替浅色环", "外侧数值" ], "adaptation_notes": "背景为交替同色环而非连续渐变;成本等指标需先统一优劣方向。", "number": 84, "kind": "recipe", "legacy_title": "雷达图(多方案对比 + 渐变背景 + 多维度覆盖 + 顶部数值标注)", "legacy_ref": "competition #5", "source": { "original_code": "sources/competition.radar/original.py", "execution_code": "sources/competition.radar/render.py", "recipe_section": "sources/competition.radar/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "ad2000767d4198fc9cbcdc3cba7faab51509d6f4472cdbe3a4307c507cc4f5e9", "code_sha256": "569c99475a6b43a40eee13858bfe18ada8171fa523888914245eeeb99ef5d53c", "execution_sha256": "569c99475a6b43a40eee13858bfe18ada8171fa523888914245eeeb99ef5d53c", "code_view": "sources/competition.radar/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.radar-1.png", "thumbnail": "thumbnails/competition.radar-1.jpg", "sha256": "fb2e388d7b8edeb8663e451f584694ab164d23a0a7386b9f7885b8b72e628c9a", "pixels": [ 1170, 1170 ], "native_inches": [ 6.5, 6.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 28, "operation": "fill_between", "code": " ax.fill_between(theta_fill, r_prev, r, alpha=0.025, color=PALETTE[0], zorder=0)" }, { "line": 29, "operation": "plot", "code": " ax.plot(theta_fill, [r]*len(theta_fill), color='#E5E5E5', linewidth=0.5, zorder=1)" }, { "line": 43, "operation": "plot", "code": " ax.plot(angles, values, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha_line, zorder=3)" }, { "line": 44, "operation": "fill", "code": " ax.fill(angles, values, color=PALETTE[i], alpha=alpha_fill, zorder=1)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.latent_interpolation", "advanced.parallel_coordinates", "advanced.method_heatmap", "empirical.prediction_accuracy_heatmap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.radar.md", "fidelity_checkpoints": [ { "feature": "极坐标面与交替浅环", "preserve": "保留闭合透明叠面、主次线宽、交替浅环与外侧读数,不以实色面遮掉其他方案。", "allowed_adaptation": "指标数量与归一化、主方案和标签位置可变,不同量纲先确定可比规则。", "evidence": [ { "line": 28, "end_line": 28, "code": " ax.fill_between(theta_fill, r_prev, r, alpha=0.025, color=PALETTE[0], zorder=0)", "href": "sources/competition.radar/original.html#L28" }, { "line": 29, "end_line": 29, "code": " ax.plot(theta_fill, [r]*len(theta_fill), color='#E5E5E5', linewidth=0.5, zorder=1)", "href": "sources/competition.radar/original.html#L29" }, { "line": 43, "end_line": 43, "code": " ax.plot(angles, values, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha_line, zorder=3)", "href": "sources/competition.radar/original.html#L43" }, { "line": 44, "end_line": 44, "code": " ax.fill(angles, values, color=PALETTE[i], alpha=alpha_fill, zorder=1)", "href": "sources/competition.radar/original.html#L44" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.surface_3d", "display_name": "三维目标曲面与底部等高线", "tags": [ "三维", "优化" ], "purpose": "两个参数改变时目标地形和极值在哪里?", "data_requirements": [ "二维规则网格", "每点目标值" ], "composition": "3D连续曲面;底部投影;侧色条", "visual_features": [ "红蓝连续色阶", "半透明曲面", "最优点标记" ], "adaptation_notes": "原代码最优点来自网格极小值;稀疏散点不直接等于连续曲面,插值需有依据。", "number": 85, "kind": "recipe", "legacy_title": "3D 曲面图(目标函数地形)", "legacy_ref": "competition #6", "source": { "original_code": "sources/competition.surface_3d/original.py", "execution_code": "sources/competition.surface_3d/render.py", "recipe_section": "sources/competition.surface_3d/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "024f06a2020a6c48298c24919b357d9c0ceb2464dba2d44b9f98b89ca3080f54", "code_sha256": "e09ac12b585158199462b0ea7df5838890fca907b3edcf38b53d34519b4a8e12", "execution_sha256": "e09ac12b585158199462b0ea7df5838890fca907b3edcf38b53d34519b4a8e12", "code_view": "sources/competition.surface_3d/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.surface_3d-1.png", "thumbnail": "thumbnails/competition.surface_3d-1.jpg", "sha256": "ab25b07d83c4663d0ad3e05dbfd9d2ce6024205d9cf78ca48938c59475a6b467", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 11, "operation": "plot_surface", "code": "surf = ax.plot_surface(X, Y, Z, cmap='coolwarm', alpha=0.85, edgecolor='none', antialiased=True)" }, { "line": 12, "operation": "contour", "code": "ax.contour(X, Y, Z, zdir='z', offset=Z.min()-0.3, cmap='coolwarm', alpha=0.3, levels=15)" }, { "line": 16, "operation": "scatter", "code": "ax.scatter([X[min_idx]], [Y[min_idx]], [Z[min_idx]], color=COLORS['down'], s=80, edgecolor='white', linewidth=1.5, zorder=10, label=f'最优点 ({X[min_idx]:.1f}, {Y[min_idx]:.1f})')" } ], "literal_colormaps": [ "coolwarm" ], "aliases": [], "related_ids": [ "academic.feature_importance", "competition.contour", "competition.feasible_region" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.surface_3d.md", "fidelity_checkpoints": [ { "feature": "半透明曲面与底部投影", "preserve": "保留 alpha=0.85 曲面、alpha=0.3 底部等高线投影及对应色条,三者用一致的连续数值映射。", "allowed_adaptation": "函数或网格、连续色相、等高线级数、底部偏移和视角可调;投影不与曲面重叠遮挡。", "evidence": [ { "line": 11, "end_line": 12, "code": "surf = ax.plot_surface(X, Y, Z, cmap='coolwarm', alpha=0.85, edgecolor='none', antialiased=True)\nax.contour(X, Y, Z, zdir='z', offset=Z.min()-0.3, cmap='coolwarm', alpha=0.3, levels=15)", "href": "sources/competition.surface_3d/original.html#L11" }, { "line": 24, "end_line": 24, "code": "fig.colorbar(surf, shrink=0.45, aspect=15, pad=0.12)", "href": "sources/competition.surface_3d/original.html#L24" } ] }, { "feature": "真实极值与空间视角", "preserve": "保留白边极值点和可读的三轴空间关系,不为了美化把极值硬放到模板坐标。", "allowed_adaptation": "按目标选最大或最小,重新计算标记;相机、轴范围与标签间距可随数据调整。", "evidence": [ { "line": 15, "end_line": 23, "code": "min_idx = np.unravel_index(Z.argmin(), Z.shape)\nax.scatter([X[min_idx]], [Y[min_idx]], [Z[min_idx]], color=COLORS['down'], s=80,\n edgecolor='white', linewidth=1.5, zorder=10, label=f'最优点 ({X[min_idx]:.1f}, {Y[min_idx]:.1f})')\n\nax.set_xlabel('参数 $x_1$', fontsize=10, labelpad=6)\nax.set_ylabel('参数 $x_2$', fontsize=10, labelpad=6)\nax.set_zlabel('目标函数值', fontsize=10, labelpad=6)\nax.view_init(elev=30, azim=135); ax.tick_params(labelsize=8)\nax.legend(fontsize=9, loc='best')", "href": "sources/competition.surface_3d/original.html#L15" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.china_choropleth", "display_name": "中国省级数值分级地图", "tags": [ "空间", "比较" ], "purpose": "区域数值高低和地理格局怎样?", "data_requirements": [ "省份名称或ID与数值", "匹配的GeoJSON" ], "composition": "省级多边形地图;右侧色条", "visual_features": [ "黄红连续数值着色", "浅边界", "省名标签" ], "adaptation_notes": "原预览东部标签较密;区域匹配、缺值及边界资源需要对应实际数据,不能把缺值补零。", "number": 86, "kind": "recipe", "legacy_title": "中国省份地图(Choropleth Map)", "legacy_ref": "competition #7", "source": { "original_code": "sources/competition.china_choropleth/original.py", "execution_code": "sources/competition.china_choropleth/render.py", "recipe_section": "sources/competition.china_choropleth/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "a05adf016dc33cd316a202b0a07df0e4822bf775a9ad027c3fb6eaa2d6efc84d", "code_sha256": "eccc990d1903903344dc708da750f657f494c6c689b3cf21636a88f98dcf879f", "execution_sha256": "eccc990d1903903344dc708da750f657f494c6c689b3cf21636a88f98dcf879f", "code_view": "sources/competition.china_choropleth/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.china_choropleth-1.png", "thumbnail": "thumbnails/competition.china_choropleth-1.jpg", "sha256": "bef2a1ca7168b22af7807aa086e5eb5c58a0658788ad02d8800b59cc29910568", "pixels": [ 1800, 1440 ], "native_inches": [ 10.0, 8.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 60, "operation": "plot", "code": " gdf_valid.plot(column='value', cmap='YlOrRd', linewidth=0.5, edgecolor='white', ax=ax, legend=False, vmin=vmin, vmax=vmax)" }, { "line": 63, "operation": "plot", "code": " gdf_no_data.plot(color='#F0F0F0', edgecolor='white', linewidth=0.5, ax=ax)" }, { "line": 105, "operation": "add_patch", "code": " ax.add_patch(patch)" } ], "literal_colormaps": [ "ScalarMappable", "YlOrRd" ], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.china_choropleth.md", "fidelity_checkpoints": [ { "feature": "连续省域着色与缺失区分", "preserve": "保留省域连续数值色阶、浅色边界、省名数值与色条,缺失区域单独处理。", "allowed_adaptation": "地图范围、数据和连续色相可变;缺失不是零,地理边界用实际底图,避免靠色名选图。", "evidence": [ { "line": 60, "end_line": 61, "code": " gdf_valid.plot(column='value', cmap='YlOrRd', linewidth=0.5,\n edgecolor='white', ax=ax, legend=False, vmin=vmin, vmax=vmax)", "href": "sources/competition.china_choropleth/original.html#L60" }, { "line": 63, "end_line": 63, "code": " gdf_no_data.plot(color='#F0F0F0', edgecolor='white', linewidth=0.5, ax=ax)", "href": "sources/competition.china_choropleth/original.html#L63" }, { "line": 72, "end_line": 75, "code": " ax.text(c.x, c.y, f'{short}\\n{v:.2f}', ha='center', va='center',\n fontsize=7, fontweight='bold', color='#333333',\n bbox=dict(boxstyle='round,pad=0.2', facecolor='white',\n edgecolor='#999999', linewidth=0.6, alpha=0.92))", "href": "sources/competition.china_choropleth/original.html#L72" }, { "line": 127, "end_line": 130, "code": " ax.text(cx, cy, f'{short}\\n{val:.2f}', ha='center', va='center',\n fontsize=7, fontweight='bold', color='#333333',\n bbox=dict(boxstyle='round,pad=0.2', facecolor='white',\n edgecolor='#999999', linewidth=0.6, alpha=0.92))", "href": "sources/competition.china_choropleth/original.html#L127" }, { "line": 137, "end_line": 137, "code": "cbar = fig.colorbar(sm, ax=ax, shrink=0.6, pad=0.02, aspect=20)", "href": "sources/competition.china_choropleth/original.html#L137" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.residual_diagnostics", "display_name": "残差分布与自相关四面板", "tags": [ "诊断", "误差", "组合" ], "purpose": "残差是否有偏、非正态或时间相关?", "data_requirements": [ "真实值与预测值", "有顺序的残差" ], "composition": "2×2:残差拟合、Q-Q、标准化分布、ACF", "visual_features": [ "透明散点", "正态参考", "自相关条形" ], "adaptation_notes": "ACF需要有意义的样本顺序;区别于实证版右下Cook距离;普通独立样本顺序不代表时间。", "number": 87, "kind": "recipe", "legacy_title": "残差诊断四合一图", "legacy_ref": "competition #8", "source": { "original_code": "sources/competition.residual_diagnostics/original.py", "execution_code": "sources/competition.residual_diagnostics/render.py", "recipe_section": "sources/competition.residual_diagnostics/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "4862ceb77b02016a80cef28e3fea0bb180c5028f17114fbef3225831d3284eb6", "code_sha256": "03fbe96bd214f6f339e09dd71f8e7d7edc277345162b8ba0fb2fde860b7893e7", "execution_sha256": "03fbe96bd214f6f339e09dd71f8e7d7edc277345162b8ba0fb2fde860b7893e7", "code_view": "sources/competition.residual_diagnostics/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.residual_diagnostics-1.png", "thumbnail": "thumbnails/competition.residual_diagnostics-1.jpg", "sha256": "eb81c232a1a0cee5607252a2a43abff762ed134fdf9ce04afb29a40563587295", "pixels": [ 900, 882 ], "native_inches": [ 5.0, 4.9 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 15, "operation": "scatter", "code": "ax.scatter(y_pred, std_resid, s=15, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.3)" }, { "line": 24, "operation": "scatter", "code": "ax.scatter(osm, osr, s=15, alpha=0.5, color=PALETTE[1], edgecolor='white', linewidth=0.3)" }, { "line": 25, "operation": "plot", "code": "ax.plot(osm, slope*np.array(osm)+intercept, '--', color=COLORS['down'], linewidth=1.2)" }, { "line": 30, "operation": "hist", "code": "ax.hist(std_resid, bins=25, density=True, color=PALETTE[0], alpha=0.4, edgecolor=PALETTE[0], linewidth=0.8)" }, { "line": 32, "operation": "plot", "code": "ax.plot(xr, stats.norm.pdf(xr), color=PALETTE[1], linewidth=2, label='正态分布')" }, { "line": 39, "operation": "bar", "code": "ax.bar(list(lags), acf, color=PALETTE[2], alpha=0.6, edgecolor=PALETTE[2], linewidth=0.8)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "empirical.residual_diagnostics" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.residual_diagnostics.md", "fidelity_checkpoints": [ { "feature": "残差四面板与自相关", "preserve": "保留残差—拟合、Q-Q、标准化分布和 ACF 的四种读法、透明点及各自参考线。", "allowed_adaptation": "残差和自相关按拟合结果计算,滞后数和版面可变;本模板第四格不是 Cook 距离。", "evidence": [ { "line": 15, "end_line": 15, "code": "ax.scatter(y_pred, std_resid, s=15, alpha=0.5, color=PALETTE[0], edgecolor='white', linewidth=0.3)", "href": "sources/competition.residual_diagnostics/original.html#L15" }, { "line": 16, "end_line": 16, "code": "ax.axhline(0, color=COLORS['ref_line'], linewidth=0.8, linestyle='--')", "href": "sources/competition.residual_diagnostics/original.html#L16" }, { "line": 17, "end_line": 17, "code": "ax.axhline(2, color=COLORS['down'], linewidth=0.5, linestyle=':', alpha=0.5)", "href": "sources/competition.residual_diagnostics/original.html#L17" }, { "line": 18, "end_line": 18, "code": "ax.axhline(-2, color=COLORS['down'], linewidth=0.5, linestyle=':', alpha=0.5)", "href": "sources/competition.residual_diagnostics/original.html#L18" }, { "line": 24, "end_line": 24, "code": "ax.scatter(osm, osr, s=15, alpha=0.5, color=PALETTE[1], edgecolor='white', linewidth=0.3)", "href": "sources/competition.residual_diagnostics/original.html#L24" }, { "line": 25, "end_line": 25, "code": "ax.plot(osm, slope*np.array(osm)+intercept, '--', color=COLORS['down'], linewidth=1.2)", "href": "sources/competition.residual_diagnostics/original.html#L25" }, { "line": 30, "end_line": 30, "code": "ax.hist(std_resid, bins=25, density=True, color=PALETTE[0], alpha=0.4, edgecolor=PALETTE[0], linewidth=0.8)", "href": "sources/competition.residual_diagnostics/original.html#L30" }, { "line": 32, "end_line": 32, "code": "ax.plot(xr, stats.norm.pdf(xr), color=PALETTE[1], linewidth=2, label='正态分布')", "href": "sources/competition.residual_diagnostics/original.html#L32" }, { "line": 39, "end_line": 39, "code": "ax.bar(list(lags), acf, color=PALETTE[2], alpha=0.6, edgecolor=PALETTE[2], linewidth=0.8)", "href": "sources/competition.residual_diagnostics/original.html#L39" }, { "line": 41, "end_line": 41, "code": "ax.axhline(ci, color=COLORS['down'], linewidth=0.5, linestyle='--', alpha=0.5)", "href": "sources/competition.residual_diagnostics/original.html#L41" }, { "line": 42, "end_line": 42, "code": "ax.axhline(-ci, color=COLORS['down'], linewidth=0.5, linestyle='--', alpha=0.5)", "href": "sources/competition.residual_diagnostics/original.html#L42" }, { "line": 43, "end_line": 43, "code": "ax.axhline(0, color=COLORS['ref_line'], linewidth=0.5)", "href": "sources/competition.residual_diagnostics/original.html#L43" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.feature_importance", "display_name": "特征贡献排序条形", "tags": [ "解释", "排序" ], "purpose": "哪些特征的重要性较高?", "data_requirements": [ "特征名和非负重要性分数" ], "composition": "降序横条;条末数值", "visual_features": [ "由重要性驱动的条间深浅", "深描边", "整洁排序" ], "adaptation_notes": "不是条内渐变,也不是SHAP方向图;重要性计算方法需明确。", "number": 88, "kind": "recipe", "legacy_title": "特征重要性排序图(渐变柱状图)", "legacy_ref": "competition #9", "source": { "original_code": "sources/competition.feature_importance/original.py", "execution_code": "sources/competition.feature_importance/render.py", "recipe_section": "sources/competition.feature_importance/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "38f62f74da62d0fdc69cccf7900bac040c80e00afed29fe920bca33c642e0411", "code_sha256": "261f8285bfe9174e52f955030d043d0feef6b372a7aa15b8dc507cdd0caf01d4", "execution_sha256": "261f8285bfe9174e52f955030d043d0feef6b372a7aa15b8dc507cdd0caf01d4", "code_view": "sources/competition.feature_importance/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.feature_importance-1.png", "thumbnail": "thumbnails/competition.feature_importance-1.jpg", "sha256": "ffc0946b5b54f6a2abd7e5ffec442448139988ef89b86220042a960358dda8ae", "pixels": [ 1260, 810 ], "native_inches": [ 7.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "barh", "code": " ax.barh(y[i], importance[i], height=0.6, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.2, zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.feature_importance.md", "fidelity_checkpoints": [ { "feature": "随重要性变化的浅条", "preserve": "保留降序横条的数值驱动深浅、_lighten 浅填充和深描边、末端数值,不能全条同色同亮度。", "allowed_adaptation": "特征数量、重要性定义及排序据实更新,色相可变但保留强弱层次。", "evidence": [ { "line": 20, "end_line": 21, "code": " ax.barh(y[i], importance[i], height=0.6,\n color=_lighten(c, 0.3), edgecolor=c, linewidth=1.2, zorder=3)", "href": "sources/competition.feature_importance/original.html#L20" }, { "line": 22, "end_line": 23, "code": " ax.text(importance[i] + max_val*0.02, y[i], f'{importance[i]:.3f}',\n va='center', ha='left', fontsize=9, fontweight='bold', color=c)", "href": "sources/competition.feature_importance/original.html#L22" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.confusion_matrix", "display_name": "分类混淆矩阵", "tags": [ "预测", "诊断", "矩阵" ], "purpose": "哪些类别识别正确,哪些类别互相混淆?", "data_requirements": [ "真实×预测类别计数或归一化矩阵" ], "composition": "方形矩阵;侧色条", "visual_features": [ "蓝色连续色阶", "格内数字", "对比色文字" ], "adaptation_notes": "必须明确行列方向和归一化单位;区别于误命名的academic.confusion_matrix雨云图。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 89, "kind": "recipe", "legacy_title": "混淆矩阵热力图", "legacy_ref": "competition #10", "source": { "original_code": "sources/competition.confusion_matrix/original.py", "execution_code": "sources/competition.confusion_matrix/render.py", "recipe_section": "sources/competition.confusion_matrix/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "4dca0a80c0f2cab62b5e2858f8c1da3a6b51ce2685f94532c4bc2b26acf25468", "code_sha256": "51a09f1c215ea0fbbb1f1dc8b6cf08814e71bc89a396892136bda79322cceea8", "execution_sha256": "51a09f1c215ea0fbbb1f1dc8b6cf08814e71bc89a396892136bda79322cceea8", "code_view": "sources/competition.confusion_matrix/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.confusion_matrix-1.png", "thumbnail": "thumbnails/competition.confusion_matrix-1.jpg", "sha256": "cdb54360a7b0365132c712a5965683ae429ddfbd737f363825661ce4bb7f4703", "pixels": [ 1290, 1080 ], "native_inches": [ 6.0, 5.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 11, "operation": "heatmap", "code": "sns.heatmap(cm_norm, annot=True, fmt='.1f', cmap=palette_cmap('sequential'), xticklabels=classes," } ], "literal_colormaps": [], "aliases": [ "confusion matrix", "混淆矩阵" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.confusion_matrix.md", "fidelity_checkpoints": [ { "feature": "百分比矩阵与数值标签", "preserve": "保留连续非负色阶、格内数字、白格线和色条,行列类别对应清晰。", "allowed_adaptation": "类别数量、归一化方式和色相可变;数字单位与色条一致,不误把行归一化当全局占比。", "evidence": [ { "line": 11, "end_line": 13, "code": "sns.heatmap(cm_norm, annot=True, fmt='.1f', cmap=palette_cmap('sequential'), xticklabels=classes,\n yticklabels=classes, linewidths=0.5, linecolor='white',\n cbar_kws={'label': '预测准确率 (%)'}, ax=ax)", "href": "sources/competition.confusion_matrix/original.html#L11" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.roc", "display_name": "多模型ROC曲线", "tags": [ "预测", "比较", "诊断" ], "purpose": "不同阈值下敏感度与误报率怎样权衡?", "data_requirements": [ "真实二分类标签和预测分数,或已计算FPR/TPR" ], "composition": "单位方形内多条ROC;对角随机参考", "visual_features": [ "模型线宽与透明度主次", "图例AUC" ], "adaptation_notes": "示例ROC坐标随机合成且图例AUC为设定值,正式应用必须从同一预测计算。", "number": 90, "kind": "recipe", "legacy_title": "ROC 曲线 + AUC 对比", "legacy_ref": "competition #11", "source": { "original_code": "sources/competition.roc/original.py", "execution_code": "sources/competition.roc/render.py", "recipe_section": "sources/competition.roc/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "262e3c90685abba1b91aa2d2eb81141f7a5aae298ba1a447bc44b5ccaf078caa", "code_sha256": "2a22278ccd1db7a4ad1c8f6aa1e487a70d3b48bede075569deeafb3587aa96a6", "execution_sha256": "2a22278ccd1db7a4ad1c8f6aa1e487a70d3b48bede075569deeafb3587aa96a6", "code_view": "sources/competition.roc/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.roc-1.png", "thumbnail": "thumbnails/competition.roc-1.jpg", "sha256": "01537215889b814b024d8bec26f36dea4b5e7cea631c2be95ebdb40cff0ab9f0", "pixels": [ 1080, 990 ], "native_inches": [ 6.0, 5.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 16, "operation": "plot", "code": "ax.plot([0,1],[0,1], '--', color=COLORS['ref_line'], linewidth=0.8, label='随机猜测')" }, { "line": 22, "operation": "plot", "code": " ax.plot(fpr, tpr, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha, zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.roc.md", "fidelity_checkpoints": [ { "feature": "ROC主次线与随机参照", "preserve": "保留模型曲线的线宽/透明度主次、随机对角参照与 AUC 图例;这个主示例没有各模型不同点形。", "allowed_adaptation": "曲线点和 AUC 来自真实分数与标签,方法数和图例位置可变,不虚构锯齿或平滑改变统计。", "evidence": [ { "line": 16, "end_line": 16, "code": "ax.plot([0,1],[0,1], '--', color=COLORS['ref_line'], linewidth=0.8, label='随机猜测')", "href": "sources/competition.roc/original.html#L16" }, { "line": 22, "end_line": 22, "code": " ax.plot(fpr, tpr, color=PALETTE[i], linewidth=lw, label=name, alpha=alpha, zorder=3)", "href": "sources/competition.roc/original.html#L22" }, { "line": 26, "end_line": 26, "code": "ax.legend(frameon=False, labelspacing=0.35, handlelength=1.6, fontsize=9, loc='lower right')", "href": "sources/competition.roc/original.html#L26" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.correlation_matrix", "display_name": "简洁下三角相关矩阵", "tags": [ "关联", "矩阵" ], "purpose": "多个变量的相关方向与强度怎样?", "data_requirements": [ "样本×变量或已计算相关矩阵" ], "composition": "下三角方格;右侧色条", "visual_features": [ "红蓝发散色", "白色遮罩", "格内数值" ], "adaptation_notes": "无树状图、无散点和分布;相关矩阵不能替代原始数据的成对关系图。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 91, "kind": "recipe", "legacy_title": "相关性矩阵图(下三角 + 数值标注)", "legacy_ref": "competition #12", "source": { "original_code": "sources/competition.correlation_matrix/original.py", "execution_code": "sources/competition.correlation_matrix/render.py", "recipe_section": "sources/competition.correlation_matrix/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "89ba81ab522615e77d1650d909a9371f835d611b018dc8f93c368771ef57be52", "code_sha256": "2ba96d2561895e23b7e6d8676e969c49e5b5484f9b886994e67bbc12d9c8b2d3", "execution_sha256": "2ba96d2561895e23b7e6d8676e969c49e5b5484f9b886994e67bbc12d9c8b2d3", "code_view": "sources/competition.correlation_matrix/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.correlation_matrix-1.png", "thumbnail": "thumbnails/competition.correlation_matrix-1.jpg", "sha256": "4489647767dc370b164c600f19673f3b9294e542c1087e497ad055239210cf61", "pixels": [ 1506, 1235 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 16, "operation": "heatmap", "code": "sns.heatmap(corr, mask=mask, annot=True, fmt='.2f', cmap=palette_cmap('diverging'), center=0," } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.pair_plot", "template.sem_violin_pearson", "empirical.correlation_heatmap", "basic.heatmap" ], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.correlation_matrix.md", "fidelity_checkpoints": [ { "feature": "带遮罩的发散相关矩阵", "preserve": "保留下三角遮罩、零中心的发散色阶、格内数值及细白分界。Pearson 相关仍按 −1 到 1 解释。", "allowed_adaptation": "变量数、排序和数字精度可变;色相按当前配色指导选择合适的发散色图,不锁死快照中的 RdBu_r。", "evidence": [ { "line": 13, "end_line": 20, "code": "mask = np.triu(np.ones_like(corr, dtype=bool), k=1)\n\nfig, ax = plt.subplots(figsize=(7, 6))\nsns.heatmap(corr, mask=mask, annot=True, fmt='.2f', cmap=palette_cmap('diverging'), center=0,\n vmin=-1, vmax=1, xticklabels=var_names, yticklabels=var_names,\n linewidths=0.5, linecolor='white', square=True,\n cbar_kws={'shrink': 0.8, 'label': '相关系数'}, ax=ax)\nax.set_xticklabels(var_names, fontsize=9, rotation=45, ha='right')", "href": "sources/competition.correlation_matrix/original.html#L13" } ] }, { "feature": "色条与格子含义一致", "preserve": "保留相关系数色条及清晰的行列变量对应,遮罩处不伪装成零相关。", "allowed_adaptation": "色条尺寸、标签位置随版面调整;换成其他指标时重新确定色阶含义,不沿用相关系数解释。", "evidence": [ { "line": 16, "end_line": 21, "code": "sns.heatmap(corr, mask=mask, annot=True, fmt='.2f', cmap=palette_cmap('diverging'), center=0,\n vmin=-1, vmax=1, xticklabels=var_names, yticklabels=var_names,\n linewidths=0.5, linecolor='white', square=True,\n cbar_kws={'shrink': 0.8, 'label': '相关系数'}, ax=ax)\nax.set_xticklabels(var_names, fontsize=9, rotation=45, ha='right')\nax.set_yticklabels(var_names, fontsize=9, rotation=0)", "href": "sources/competition.correlation_matrix/original.html#L16" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.gravity_migration", "display_name": "空间重心时间轨迹", "tags": [ "空间", "时间", "趋势" ], "purpose": "空间重心如何随年份迁移?", "data_requirements": [ "按时间排序的二维地理坐标", "可由加权地点计算重心" ], "composition": "空间平面上的有向折线;背景密度", "visual_features": [ "起止点突出", "沿途年份", "浅KDE背景" ], "adaptation_notes": "代码直接模拟坐标,未计算加权重心;经纬度距离不应直接当作等距米制距离。", "number": 92, "kind": "recipe", "legacy_title": "重心迁移轨迹图", "legacy_ref": "competition #13", "source": { "original_code": "sources/competition.gravity_migration/original.py", "execution_code": "sources/competition.gravity_migration/render.py", "recipe_section": "sources/competition.gravity_migration/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "3c3676583f313ec8e6be1f44c637d13cdfdd7c14f54435fb17c06bf91bcf1863", "code_sha256": "1773c5c63644189badb60ea715233fe5df20ed6b764eba6695c8c9a838c148d5", "execution_sha256": "1773c5c63644189badb60ea715233fe5df20ed6b764eba6695c8c9a838c148d5", "code_view": "sources/competition.gravity_migration/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.gravity_migration-1.png", "thumbnail": "thumbnails/competition.gravity_migration-1.jpg", "sha256": "7e7d6fed74c1f2470224f9fb1d5c60dfc6183d0c334a4f0ffbd9cce7fbccf589", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "contourf", "code": "ax.contourf(Xg, Yg, Zg, levels=8, cmap='Blues', alpha=0.15, zorder=0)" }, { "line": 29, "operation": "scatter", "code": "ax.scatter(cx[0], cy[0], s=120, color=COLORS['up'], edgecolor='white', linewidth=2, zorder=5, label=f'起点 ({years[0]})')" }, { "line": 30, "operation": "scatter", "code": "ax.scatter(cx[-1], cy[-1], s=120, color=COLORS['down'], edgecolor='white', linewidth=2, zorder=5, marker='*', label=f'终点 ({years[-1]})')" } ], "literal_colormaps": [ "Blues" ], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.gravity_migration.md", "fidelity_checkpoints": [ { "feature": "迁移箭头与密度浅底", "preserve": "保留浅 KDE 背景、有向阶段路径、起止重点点与沿途年份,不能去掉方向信息。", "allowed_adaptation": "由实际位置或重心计算顺序和密度,坐标范围、箭头偏移与标签避让可调。", "evidence": [ { "line": 20, "end_line": 20, "code": "ax.contourf(Xg, Yg, Zg, levels=8, cmap='Blues', alpha=0.15, zorder=0)", "href": "sources/competition.gravity_migration/original.html#L20" }, { "line": 25, "end_line": 26, "code": " ax.annotate('', xy=(cx[i+1], cy[i+1]), xytext=(cx[i], cy[i]),\n arrowprops=dict(arrowstyle='->', color=PALETTE[0], lw=1.5, alpha=alpha))", "href": "sources/competition.gravity_migration/original.html#L25" }, { "line": 29, "end_line": 29, "code": "ax.scatter(cx[0], cy[0], s=120, color=COLORS['up'], edgecolor='white', linewidth=2, zorder=5, label=f'起点 ({years[0]})')", "href": "sources/competition.gravity_migration/original.html#L29" }, { "line": 30, "end_line": 30, "code": "ax.scatter(cx[-1], cy[-1], s=120, color=COLORS['down'], edgecolor='white', linewidth=2, zorder=5, marker='*', label=f'终点 ({years[-1]})')", "href": "sources/competition.gravity_migration/original.html#L30" }, { "line": 34, "end_line": 35, "code": " ax.text(cx[i]+0.05, cy[i]+0.05, str(years[i]), fontsize=8, fontweight='bold',\n bbox=dict(facecolor='white', alpha=0.7, edgecolor='none', pad=1))", "href": "sources/competition.gravity_migration/original.html#L34" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.contour", "display_name": "双参数目标等高线", "tags": [ "优化", "矩阵" ], "purpose": "双参数空间中的低谷和优选区域在哪里?", "data_requirements": [ "规则参数网格与目标值" ], "composition": "俯视填色等高线;等值线和色条", "visual_features": [ "暖色连续层次", "最优星号", "目标对数显示" ], "adaptation_notes": "当前色条使用目标变换,需明确log口径;比3D曲面更便于定位二维参数范围。", "number": 93, "kind": "recipe", "legacy_title": "等高线图(双变量参数搜索)", "legacy_ref": "competition #14", "source": { "original_code": "sources/competition.contour/original.py", "execution_code": "sources/competition.contour/render.py", "recipe_section": "sources/competition.contour/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "b70c00ac38fe8c7399da15d8ae910e639c7d23c0ceba7f371ce7d05b2f21210f", "code_sha256": "e35430683a8f52a83e176d945407d3526e2bb2ff62c0c6a00349865c7fa96f9f", "execution_sha256": "e35430683a8f52a83e176d945407d3526e2bb2ff62c0c6a00349865c7fa96f9f", "code_view": "sources/competition.contour/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.contour-1.png", "thumbnail": "thumbnails/competition.contour-1.jpg", "sha256": "901ea41aa3fcbcf6ca9f26c868a167b89b293a574b10890610ff60747b2c41f5", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 11, "operation": "contourf", "code": "cf = ax.contourf(X, Y, Z, levels=20, cmap='YlOrRd', alpha=0.8)" }, { "line": 12, "operation": "contour", "code": "cs = ax.contour(X, Y, Z, levels=10, colors='white', linewidths=0.5, alpha=0.6)" }, { "line": 16, "operation": "scatter", "code": "ax.scatter([1], [1], s=100, color=COLORS['down'], edgecolor='white', linewidth=2, zorder=5, marker='*')" } ], "literal_colormaps": [ "YlOrRd" ], "aliases": [], "related_ids": [ "competition.surface_3d", "academic.feature_importance", "competition.feasible_region" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.contour.md", "fidelity_checkpoints": [ { "feature": "填色面与白色等值线", "preserve": "保留连续填色、叠加白色等值线、最优白边星号和准确色条,不只留下纯色块。", "allowed_adaptation": "网格、连续色相和等值级数可变;最优点和变换标签由实际目标函数确定。", "evidence": [ { "line": 11, "end_line": 11, "code": "cf = ax.contourf(X, Y, Z, levels=20, cmap='YlOrRd', alpha=0.8)", "href": "sources/competition.contour/original.html#L11" }, { "line": 12, "end_line": 12, "code": "cs = ax.contour(X, Y, Z, levels=10, colors='white', linewidths=0.5, alpha=0.6)", "href": "sources/competition.contour/original.html#L12" }, { "line": 16, "end_line": 16, "code": "ax.scatter([1], [1], s=100, color=COLORS['down'], edgecolor='white', linewidth=2, zorder=5, marker='*')", "href": "sources/competition.contour/original.html#L16" }, { "line": 22, "end_line": 22, "code": "fig.colorbar(cf, ax=ax, shrink=0.8, label='$\\\\log_{10}(f+1)$')", "href": "sources/competition.contour/original.html#L22" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.gantt", "display_name": "任务排程甘特图", "tags": [ "时间", "调度" ], "purpose": "任务何时开始结束,哪些时间段重叠?", "data_requirements": [ "任务名称", "开始时间", "持续时间", "资源组" ], "composition": "任务行×时间;水平时间条", "visual_features": [ "浅填充深描边", "任务时长文字", "总完工时间竖线" ], "adaptation_notes": "模板展示排程,不执行约束求解;重叠是否冲突依赖资源与任务规则。", "number": 94, "kind": "recipe", "legacy_title": "甘特图(彩色条形 + 原色边框 + 里程碑/排斥标记)", "legacy_ref": "competition #15", "source": { "original_code": "sources/competition.gantt/original.py", "execution_code": "sources/competition.gantt/render.py", "recipe_section": "sources/competition.gantt/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "0b66d2f6c75068957d0857510791c0b802f4b62c69032267c1a96bd66f7c65cb", "code_sha256": "3121be8dadb19d53d05dca5e20154664f57f7a6add00d75bc817aa1b8852d935", "execution_sha256": "3121be8dadb19d53d05dca5e20154664f57f7a6add00d75bc817aa1b8852d935", "code_view": "sources/competition.gantt/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.gantt-1.png", "thumbnail": "thumbnails/competition.gantt-1.jpg", "sha256": "bbd9fa8c12050d156b4da9ef0136695a1561ac51f4590644ca2639dad3ac41df", "pixels": [ 1800, 900 ], "native_inches": [ 10.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 18, "operation": "barh", "code": " ax.barh(i, durations[i], left=starts[i], height=0.6, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.gantt.md", "fidelity_checkpoints": [ { "feature": "浅任务条与完工线", "preserve": "保留任务起止形成的水平条、浅填充深边、任务标签和总完工竖线。", "allowed_adaptation": "任务数、时长、排序和时间单位可变,完工时间重算;任务条位置由真实起止决定。", "evidence": [ { "line": 18, "end_line": 19, "code": " ax.barh(i, durations[i], left=starts[i], height=0.6,\n color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)", "href": "sources/competition.gantt/original.html#L18" }, { "line": 20, "end_line": 21, "code": " ax.text(starts[i] + durations[i]/2, i, f'J{i+1}', ha='center', va='center',\n fontsize=8, fontweight='bold', color=c)", "href": "sources/competition.gantt/original.html#L20" }, { "line": 25, "end_line": 25, "code": "ax.axvline(makespan, color=COLORS['down'], linewidth=1.5, linestyle='--', zorder=4)", "href": "sources/competition.gantt/original.html#L25" }, { "line": 28, "end_line": 30, "code": "ax.text(makespan, -0.8, f'Makespan={makespan}h',\n ha='center', va='center', fontsize=9, fontweight='bold', color=COLORS['down'],\n bbox=dict(boxstyle='round,pad=0.3', facecolor='white', edgecolor=COLORS['down'], alpha=0.9))", "href": "sources/competition.gantt/original.html#L28" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.network_path", "display_name": "网络路线与节点布局", "tags": [ "网络", "优化", "空间" ], "purpose": "路径经过哪些节点,怎样区别于其他边?", "data_requirements": [ "节点二维坐标", "边集", "实际求得的路径" ], "composition": "平面节点与边;高亮路线", "visual_features": [ "背景边很浅", "主路线加粗", "节点白边和编号" ], "adaptation_notes": "示例图与路线为模拟,不能据此声称最短或可行;路径边必须存在于真实图中。", "number": 95, "kind": "recipe", "legacy_title": "网络路径/路线规划图(彩色边 + 原色边框节点)", "legacy_ref": "competition #16", "source": { "original_code": "sources/competition.network_path/original.py", "execution_code": "sources/competition.network_path/render.py", "recipe_section": "sources/competition.network_path/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "93d0080426e58d1a467de241d17d3157a4e197bf4065ef2989cf020ac5c19f7f", "code_sha256": "4443417e1becea3ffb28e071d35987131f30d5801f0f09194580c184727adaea", "execution_sha256": "4443417e1becea3ffb28e071d35987131f30d5801f0f09194580c184727adaea", "code_view": "sources/competition.network_path/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.network_path-1.png", "thumbnail": "thumbnails/competition.network_path-1.jpg", "sha256": "b6fc6cf704dfddc20d675906170e1f29389e87e874911c140b68f70377283fb0", "pixels": [ 1440, 1260 ], "native_inches": [ 8.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "plot", "code": " ax.plot([pos[i,0], pos[j,0]], [pos[i,1], pos[j,1]], color=COLORS['grid'], linewidth=0.8, alpha=0.3, zorder=1)" }, { "line": 32, "operation": "plot", "code": " ax.plot([pos[i,0], pos[j,0]], [pos[i,1], pos[j,1]], color=PALETTE[0], linewidth=3, alpha=0.8, zorder=3)" }, { "line": 46, "operation": "scatter", "code": " ax.scatter(pos[i,0], pos[i,1], s=s, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.5, zorder=5, marker=marker)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.network_path.md", "fidelity_checkpoints": [ { "feature": "浅背景网络与主路线", "preserve": "保留浅背景边、加粗主路线、节点形状/描边与标签,路径必须从背景网络中突出。", "allowed_adaptation": "节点位置、权重、路线和端点身份据实替换,文字可避让,不为构图伪造连接。", "evidence": [ { "line": 26, "end_line": 27, "code": " ax.plot([pos[i,0], pos[j,0]], [pos[i,1], pos[j,1]],\n color=COLORS['grid'], linewidth=0.8, alpha=0.3, zorder=1)", "href": "sources/competition.network_path/original.html#L26" }, { "line": 32, "end_line": 33, "code": " ax.plot([pos[i,0], pos[j,0]], [pos[i,1], pos[j,1]],\n color=PALETTE[0], linewidth=3, alpha=0.8, zorder=3)", "href": "sources/competition.network_path/original.html#L32" }, { "line": 37, "end_line": 38, "code": " ax.text(mx, my, f'{w:.1f}', fontsize=7, ha='center', va='center',\n bbox=dict(facecolor='white', alpha=0.8, edgecolor='none', pad=1))", "href": "sources/competition.network_path/original.html#L37" }, { "line": 46, "end_line": 47, "code": " ax.scatter(pos[i,0], pos[i,1], s=s, color=_lighten(c, 0.3), edgecolor=c,\n linewidth=1.5, zorder=5, marker=marker)", "href": "sources/competition.network_path/original.html#L46" }, { "line": 48, "end_line": 50, "code": " ax.text(pos[i,0], pos[i,1]+0.3, labels[i], ha='center', va='bottom',\n fontsize=9, fontweight='bold',\n bbox=dict(facecolor='white', alpha=0.8, edgecolor=COLORS['grid'], pad=1.5))", "href": "sources/competition.network_path/original.html#L48" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.multistep_decay", "display_name": "多步预测性能衰减", "tags": [ "预测", "趋势", "比较" ], "purpose": "预测步长增长时模型何时失去可用精度?", "data_requirements": [ "步长×模型的评价分数" ], "composition": "多折线;阈值参考", "visual_features": [ "主模型粗线和浅带", "不同点形", "阈值标签" ], "adaptation_notes": "示例色带宽度为演示,非实测不确定性;阈值依据应用需求设定。", "number": 96, "kind": "recipe", "legacy_title": "多步预测衰减图", "legacy_ref": "competition #17", "source": { "original_code": "sources/competition.multistep_decay/original.py", "execution_code": "sources/competition.multistep_decay/render.py", "recipe_section": "sources/competition.multistep_decay/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "5d5342043b7ad36159898e605d146301c9edb1b5f74fc5a55c07b0626fc9cbc2", "code_sha256": "aeda91125b9e1ef1e53ba66ac3eefdb570259d002de010cd2066facd5437cda1", "execution_sha256": "aeda91125b9e1ef1e53ba66ac3eefdb570259d002de010cd2066facd5437cda1", "code_view": "sources/competition.multistep_decay/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.multistep_decay-1.png", "thumbnail": "thumbnails/competition.multistep_decay-1.jpg", "sha256": "1809bba656058dce40e90b8dcfab7e90afec5e81d4f12103f9f426975a02a18f", "pixels": [ 1260, 810 ], "native_inches": [ 7.0, 4.5 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 21, "operation": "plot", "code": " ax.plot(steps, vals, color=PALETTE[i], linewidth=lw, marker='o', markersize=5, markeredgecolor='white', markeredgewidth=1, label=name, alpha=alpha, zorder=3)" }, { "line": 25, "operation": "fill_between", "code": " ax.fill_between(steps, vals-std, vals+std, alpha=0.12, color=PALETTE[i])" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "empirical.multistep_decay" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.multistep_decay.md", "fidelity_checkpoints": [ { "feature": "主模型区间与阈值", "preserve": "保留主模型粗线和浅带、白边点与阈值参考;源码的浅带围绕单个主模型,不是所有方法跨度。", "allowed_adaptation": "步数、方法、阈值和区间重新确定,没有重复结果时不复制示例 std。", "evidence": [ { "line": 21, "end_line": 22, "code": " ax.plot(steps, vals, color=PALETTE[i], linewidth=lw, marker='o', markersize=5,\n markeredgecolor='white', markeredgewidth=1, label=name, alpha=alpha, zorder=3)", "href": "sources/competition.multistep_decay/original.html#L21" }, { "line": 25, "end_line": 25, "code": " ax.fill_between(steps, vals-std, vals+std, alpha=0.12, color=PALETTE[i])", "href": "sources/competition.multistep_decay/original.html#L25" }, { "line": 28, "end_line": 28, "code": "ax.axhline(0.5, color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5)", "href": "sources/competition.multistep_decay/original.html#L28" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.spatiotemporal_heatmap", "display_name": "地区年份数值热力表", "tags": [ "空间", "时间", "矩阵" ], "purpose": "各地区不同年份的高低值和变化模式怎样?", "data_requirements": [ "地区×年份数值矩阵" ], "composition": "地区行;年份列;侧色条", "visual_features": [ "黄红色阶", "格内原值", "白格线" ], "adaptation_notes": "这是离散地区列表而非连续空间坐标;跨地区同一指标应使用同一色标。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 97, "kind": "recipe", "legacy_title": "时空经济热力图", "legacy_ref": "competition #18", "source": { "original_code": "sources/competition.spatiotemporal_heatmap/original.py", "execution_code": "sources/competition.spatiotemporal_heatmap/render.py", "recipe_section": "sources/competition.spatiotemporal_heatmap/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "04aacf9c46e9299f292ce62b4a297b37d76bbe28a8aefcbf742776503efb3ac9", "code_sha256": "bbd339716ead29fd96b35c4941c73d75ec6532a4d082fb204a81c531c2c19eba", "execution_sha256": "bbd339716ead29fd96b35c4941c73d75ec6532a4d082fb204a81c531c2c19eba", "code_view": "sources/competition.spatiotemporal_heatmap/original.html", "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.spatiotemporal_heatmap-1.png", "thumbnail": "thumbnails/competition.spatiotemporal_heatmap-1.jpg", "sha256": "41db44a57800c2d29e4fea1a5f50e3cb4cf3dede30b81c3763bcd5f678bff053", "pixels": [ 1838, 1080 ], "native_inches": [ 9.0, 5.0 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 13, "operation": "heatmap", "code": "sns.heatmap(data, annot=True, fmt='.1f', cmap=palette_cmap('sequential')," } ], "literal_colormaps": [], "aliases": [], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.spatiotemporal_heatmap.md", "fidelity_checkpoints": [ { "feature": "地区时间格与原值", "preserve": "保留地区行、年份列的顺序、连续色阶、原值注释、细白格线及有单位的色条。", "allowed_adaptation": "时段、地区数量、数值精度和连续色相可变,不因检索分组而任意打乱时间。", "evidence": [ { "line": 13, "end_line": 16, "code": "sns.heatmap(data, annot=True, fmt='.1f', cmap=palette_cmap('sequential'),\n xticklabels=years, yticklabels=regions,\n linewidths=0.3, linecolor='white',\n cbar_kws={'label': 'GDP增长率 (%)', 'shrink': 0.8}, ax=ax)", "href": "sources/competition.spatiotemporal_heatmap/original.html#L13" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.pareto_surface_3d", "display_name": "三目标候选解与前沿散点", "tags": [ "三维", "优化", "比较" ], "purpose": "三目标解集的折中关系和分布怎样?", "data_requirements": [ "三目标值", "非支配筛选结果", "其他候选解" ], "composition": "3D散点;背景候选与前景解集", "visual_features": [ "灰色透明背景点", "第三目标连续着色", "白点边" ], "adaptation_notes": "名称称曲面,代码实际没有曲面网格;示例标签为生成分组,未验证所有点的非支配性。", "number": 98, "kind": "recipe", "legacy_title": "3D Pareto 曲面(三目标优化)", "legacy_ref": "competition #19", "source": { "original_code": "sources/competition.pareto_surface_3d/original.py", "execution_code": "sources/competition.pareto_surface_3d/render.py", "recipe_section": "sources/competition.pareto_surface_3d/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "7a03edeb1d9c12ae7b6bbc37fb208c473e1b0f386e24ff9f1c77ae5cfde3735c", "code_sha256": "1d0c5a5b8058a7ee82b64ab04cc055479c88c0d3fbba047950e2b46e3d00b4a0", "execution_sha256": "1d0c5a5b8058a7ee82b64ab04cc055479c88c0d3fbba047950e2b46e3d00b4a0", "code_view": "sources/competition.pareto_surface_3d/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.pareto_surface_3d-1.png", "thumbnail": "thumbnails/competition.pareto_surface_3d-1.jpg", "sha256": "e2d50e18eac168e2a9b1916ce5be29de69581b419e32feac21c237aecb7b72df", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "scatter", "code": "ax.scatter(other_f1, other_f2, other_f3, s=8, alpha=0.15, color=COLORS['neutral'])" }, { "line": 25, "operation": "scatter", "code": "sc = ax.scatter(f1, f2, f3, c=f3, cmap='coolwarm', s=25, alpha=0.7, edgecolor='white', linewidth=0.3, zorder=3)" } ], "literal_colormaps": [ "coolwarm" ], "aliases": [ "3d Pareto scatter", "三目标解集" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.pareto_surface_3d.md", "fidelity_checkpoints": [ { "feature": "背景候选与前沿点云", "preserve": "保留灰色透明背景点、前景解集的连续着色和白边;实际源码是点云,不强制加出不存在的曲面。", "allowed_adaptation": "实际候选集与非支配集、三目标范围和视角可变,连续色条仍解释所映射的目标。", "evidence": [ { "line": 23, "end_line": 23, "code": "ax.scatter(other_f1, other_f2, other_f3, s=8, alpha=0.15, color=COLORS['neutral'])", "href": "sources/competition.pareto_surface_3d/original.html#L23" }, { "line": 25, "end_line": 26, "code": "sc = ax.scatter(f1, f2, f3, c=f3, cmap='coolwarm', s=25, alpha=0.7,\n edgecolor='white', linewidth=0.3, zorder=3)", "href": "sources/competition.pareto_surface_3d/original.html#L25" }, { "line": 33, "end_line": 33, "code": "fig.colorbar(sc, shrink=0.5, aspect=15, pad=0.1, label='f₃ 值')", "href": "sources/competition.pareto_surface_3d/original.html#L33" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.waterfall", "display_name": "增减贡献浮动柱瀑布", "tags": [ "变化", "组成" ], "purpose": "初始值经过各项增减如何形成最终值?", "data_requirements": [ "初始总量", "各步骤带符号增量" ], "composition": "首尾总量柱;中间浮动增减柱;连接线", "visual_features": [ "浅填充深边", "顶部变化值", "累计高度" ], "adaptation_notes": "区别于advanced.waterfall的阶梯色带;需核对首尾总量与步骤加总一致。", "number": 99, "kind": "recipe", "legacy_title": "瀑布图(彩色渐变柱图 + 连接线 + 顶部数值标注)", "legacy_ref": "competition #20", "source": { "original_code": "sources/competition.waterfall/original.py", "execution_code": "sources/competition.waterfall/render.py", "recipe_section": "sources/competition.waterfall/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "5b9f1ea3605424dc8df81672218321c6ca743146e6fd34772c26b50097db8f89", "code_sha256": "d94448efb2214861b12bd76e587918c23ec2e48910d98217a1b294a5fe668157", "execution_sha256": "d94448efb2214861b12bd76e587918c23ec2e48910d98217a1b294a5fe668157", "code_view": "sources/competition.waterfall/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.waterfall-1.png", "thumbnail": "thumbnails/competition.waterfall-1.jpg", "sha256": "b0c87e544707a167d1eba7960b16ff3239f110ef235e28138dd3c0a98cf7750d", "pixels": [ 1800, 900 ], "native_inches": [ 10.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 36, "operation": "bar", "code": " ax.bar(i, h, bottom=bottoms[i], width=0.6, color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)" }, { "line": 47, "operation": "plot", "code": " ax.plot([i+0.3, i+0.7], [cumulative[i], cumulative[i]], color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "advanced.waterfall", "academic.ablation", "advanced.diverging_bar" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.waterfall.md", "fidelity_checkpoints": [ { "feature": "浮动增减柱和累计连接", "preserve": "保留首尾总量柱、中间浮动柱的 bottom、浅填充深边和累计水平连接线;不是 advanced.waterfall 的阶梯带。", "allowed_adaptation": "增减项、总量和基线据实重算,颜色跟随增减含义,标签位置可调。", "evidence": [ { "line": 36, "end_line": 37, "code": " ax.bar(i, h, bottom=bottoms[i], width=0.6,\n color=_lighten(c, 0.3), edgecolor=c, linewidth=1.3, zorder=3)", "href": "sources/competition.waterfall/original.html#L36" }, { "line": 42, "end_line": 43, "code": " ax.text(i, val_y, f'{sign}{values[i] if i < len(categories)-1 else cumulative[i]}',\n ha='center', va='bottom', fontsize=8.5, fontweight='bold', color=c)", "href": "sources/competition.waterfall/original.html#L42" }, { "line": 47, "end_line": 48, "code": " ax.plot([i+0.3, i+0.7], [cumulative[i], cumulative[i]],\n color=COLORS['ref_line'], linewidth=0.8, linestyle='--', alpha=0.5)", "href": "sources/competition.waterfall/original.html#L47" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.bubble_joint", "display_name": "气泡与双边际密度", "tags": [ "关联", "多维", "分布", "组合" ], "purpose": "两个变量的关系与第三个量如何同时展示?", "data_requirements": [ "配对x、y与非负大小变量z" ], "composition": "主气泡图;顶部与右侧KDE;侧色条", "visual_features": [ "气泡大小和颜色均编码z", "透明重叠", "浅边际密度" ], "adaptation_notes": "与仅固定大小散点的bubble_kde不同;大小图例和面积缩放需按数值含义适配。", "number": 100, "kind": "recipe", "legacy_title": "气泡图 + KDE 联合分布(Jointplot 风格)", "legacy_ref": "competition #21", "source": { "original_code": "sources/competition.bubble_joint/original.py", "execution_code": "sources/competition.bubble_joint/render.py", "recipe_section": "sources/competition.bubble_joint/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "1e2726358b320d6b2d3698946229dff408fa9d1a67a7895c5703c9f6335f0224", "code_sha256": "0efa3adc5aad03a3159aba12c85d794efcb04b9286f0faaf67e89200473b20cf", "execution_sha256": "0efa3adc5aad03a3159aba12c85d794efcb04b9286f0faaf67e89200473b20cf", "code_view": "sources/competition.bubble_joint/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.bubble_joint-1.png", "thumbnail": "thumbnails/competition.bubble_joint-1.jpg", "sha256": "49b6a76ca8e45d3244a53c4c3b2c9ebf64eb950877d0a5eddca3263cffcd7e97", "pixels": [ 1260, 1260 ], "native_inches": [ 7.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "scatter", "code": "sc = ax_main.scatter(x, y, s=z*3, c=z, cmap='YlOrRd', alpha=0.6, edgecolor='white', linewidth=0.5)" }, { "line": 27, "operation": "fill_between", "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])" }, { "line": 28, "operation": "plot", "code": "ax_top.plot(xx, kde_x(xx), color=PALETTE[0], linewidth=1.5)" }, { "line": 35, "operation": "fill_betweenx", "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])" }, { "line": 36, "operation": "plot", "code": "ax_right.plot(kde_y(yy), yy, color=PALETTE[1], linewidth=1.5)" } ], "literal_colormaps": [ "YlOrRd" ], "aliases": [], "related_ids": [ "basic.scatter_regression", "competition.scatter_regression_marginals", "competition.kde_joint", "competition.hexbin_joint", "competition.bubble_kde" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.bubble_joint.md", "fidelity_checkpoints": [ { "feature": "大小颜色双编码和边际", "preserve": "保留 z 同时映射气泡大小与连续颜色、透明叠加,以及顶部/右侧浅密度和轮廓。", "allowed_adaptation": "变量、大小缩放、带宽和色相可变,气泡面积与映射关系说明清楚;不能把点都设成同样大小。", "evidence": [ { "line": 20, "end_line": 21, "code": "sc = ax_main.scatter(x, y, s=z*3, c=z, cmap='YlOrRd', alpha=0.6,\n edgecolor='white', linewidth=0.5)", "href": "sources/competition.bubble_joint/original.html#L20" }, { "line": 27, "end_line": 27, "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])", "href": "sources/competition.bubble_joint/original.html#L27" }, { "line": 35, "end_line": 35, "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])", "href": "sources/competition.bubble_joint/original.html#L35" }, { "line": 43, "end_line": 43, "code": "fig.colorbar(sc, ax=ax_right, shrink=0.6, label='气泡大小 Z')", "href": "sources/competition.bubble_joint/original.html#L43" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.bubble_kde", "display_name": "二维密度等高线与散点", "tags": [ "关联", "分布" ], "purpose": "样本在哪些二维区域聚集,是否有多个峰?", "data_requirements": [ "逐样本配对x、y" ], "composition": "单面板散点叠加二维KDE", "visual_features": [ "蓝色透明密度层", "轮廓线", "小散点" ], "adaptation_notes": "原名气泡图,实际散点固定大小,没有第三变量;密度依赖带宽与样本量。", "number": 101, "kind": "recipe", "legacy_title": "气泡图 + KDE 叠加", "legacy_ref": "competition #22", "source": { "original_code": "sources/competition.bubble_kde/original.py", "execution_code": "sources/competition.bubble_kde/render.py", "recipe_section": "sources/competition.bubble_kde/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "50cc6d931e30aa82e8f5615f683b9b77217b1759708c2df3b59b2ac2d8026b4d", "code_sha256": "0e7218ab48b06682dffea7cc76987a5a48d987187e326c6a4f6cf2760cc0d534", "execution_sha256": "0e7218ab48b06682dffea7cc76987a5a48d987187e326c6a4f6cf2760cc0d534", "code_view": "sources/competition.bubble_kde/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.bubble_kde-1.png", "thumbnail": "thumbnails/competition.bubble_kde-1.jpg", "sha256": "d951aa26646fe80e5262b4b5fd965e01305c518c6931e0d3e866771b0aa27753", "pixels": [ 1260, 1080 ], "native_inches": [ 7.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 18, "operation": "contourf", "code": "ax.contourf(Xg, Yg, Zg, levels=10, cmap='Blues', alpha=0.3)" }, { "line": 19, "operation": "contour", "code": "ax.contour(Xg, Yg, Zg, levels=6, colors=PALETTE[0], linewidths=0.8, alpha=0.5)" }, { "line": 22, "operation": "scatter", "code": "ax.scatter(x, y, s=12, alpha=0.4, color=PALETTE[0], edgecolor='white', linewidth=0.3)" } ], "literal_colormaps": [ "Blues" ], "aliases": [ "KDE contour", "二维密度散点" ], "related_ids": [ "basic.scatter_regression", "competition.scatter_regression_marginals", "competition.kde_joint", "competition.hexbin_joint", "competition.bubble_joint" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.bubble_kde.md", "fidelity_checkpoints": [ { "feature": "二维浅密度与轮廓", "preserve": "保留浅密度层、独立轮廓与透明小散点;实际代码固定点大小,没有第三变量气泡映射。", "allowed_adaptation": "KDE 带宽、等高线级数、连续色相和点密度可变,保持密度图与样本来自同一数据。", "evidence": [ { "line": 18, "end_line": 18, "code": "ax.contourf(Xg, Yg, Zg, levels=10, cmap='Blues', alpha=0.3)", "href": "sources/competition.bubble_kde/original.html#L18" }, { "line": 19, "end_line": 19, "code": "ax.contour(Xg, Yg, Zg, levels=6, colors=PALETTE[0], linewidths=0.8, alpha=0.5)", "href": "sources/competition.bubble_kde/original.html#L19" }, { "line": 22, "end_line": 22, "code": "ax.scatter(x, y, s=12, alpha=0.4, color=PALETTE[0], edgecolor='white', linewidth=0.3)", "href": "sources/competition.bubble_kde/original.html#L22" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.kmeans", "display_name": "聚类分布与轮廓系数双面板", "tags": [ "聚类", "诊断", "组合" ], "purpose": "簇在哪里,样本归属质量怎样?", "data_requirements": [ "连续特征", "聚类设置或标签", "轮廓系数" ], "composition": "左二维聚类散点;右按簇轮廓系数条带", "visual_features": [ "类色对应", "中心叉号", "平均轮廓分界" ], "adaptation_notes": "需要真实聚类及指标;二维坐标应说明是原特征还是投影,示例簇较清晰不保证真实数据如此。", "number": 102, "kind": "recipe", "legacy_title": "K-means 聚类双面板图(外部轮廓 + 内部散点)", "legacy_ref": "competition #23", "source": { "original_code": "sources/competition.kmeans/original.py", "execution_code": "sources/competition.kmeans/render.py", "recipe_section": "sources/competition.kmeans/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "d878dee23065cd7eddd4a0788fb836bbd7d9bda64ac537fdc6e66c9d71c230c7", "code_sha256": "2c3acf0f0d7a420476cb2889659716b8ccf5f2428ac4d1a7e79cf557a0960446", "execution_sha256": "2c3acf0f0d7a420476cb2889659716b8ccf5f2428ac4d1a7e79cf557a0960446", "code_view": "sources/competition.kmeans/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.kmeans-1.png", "thumbnail": "thumbnails/competition.kmeans-1.jpg", "sha256": "e3b318492112d2143edd6ae43f45398c24b2f428820e1f4ca19ddc8cde12f984", "pixels": [ 2160, 900 ], "native_inches": [ 12.0, 5.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 19, "operation": "scatter", "code": " ax1.scatter(X[mask, 0], X[mask, 1], s=20, alpha=0.5, color=PALETTE[k], edgecolor='white', linewidth=0.3, label=f'簇 {k+1}')" }, { "line": 21, "operation": "scatter", "code": "ax1.scatter(centers[:, 0], centers[:, 1], s=200, color=COLORS['text'], marker='X', edgecolor='white', linewidth=2, zorder=5, label='质心')" }, { "line": 34, "operation": "fill_betweenx", "code": " ax2.fill_betweenx(np.arange(y_lower, y_upper), 0, cluster_sil, alpha=0.5, color=PALETTE[k])" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.benchmark_table", "competition.cluster_3d", "academic.tsne_umap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.kmeans.md", "fidelity_checkpoints": [ { "feature": "聚类点与轮廓系数双面板", "preserve": "保留左侧类色点云与白边中心叉号、右侧同类色轮廓系数填带及均值参考。", "allowed_adaptation": "簇数、模型和投影坐标可变,轮廓系数按真实聚类计算,双面板类别颜色一致。", "evidence": [ { "line": 19, "end_line": 20, "code": " ax1.scatter(X[mask, 0], X[mask, 1], s=20, alpha=0.5, color=PALETTE[k],\n edgecolor='white', linewidth=0.3, label=f'簇 {k+1}')", "href": "sources/competition.kmeans/original.html#L19" }, { "line": 21, "end_line": 22, "code": "ax1.scatter(centers[:, 0], centers[:, 1], s=200, color=COLORS['text'], marker='X',\n edgecolor='white', linewidth=2, zorder=5, label='质心')", "href": "sources/competition.kmeans/original.html#L21" }, { "line": 34, "end_line": 35, "code": " ax2.fill_betweenx(np.arange(y_lower, y_upper), 0, cluster_sil,\n alpha=0.5, color=PALETTE[k])", "href": "sources/competition.kmeans/original.html#L34" }, { "line": 40, "end_line": 41, "code": "ax2.axvline(avg_sil, color=COLORS['down'], linewidth=1.5, linestyle='--',\n label=f'平均轮廓系数={avg_sil:.3f}')", "href": "sources/competition.kmeans/original.html#L40" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.hexbin_joint", "display_name": "六边形计数与边际直方", "tags": [ "关联", "分布", "组合" ], "purpose": "大量重叠样本的联合频数怎样分布?", "data_requirements": [ "逐样本配对连续x、y" ], "composition": "主图六边形分箱;上与右边际直方", "visual_features": [ "黄红频数色阶", "回归虚线", "浅色边际" ], "adaptation_notes": "适合大量点重叠;格子大小改变颗粒感;颜色是计数不是第三个实测变量。", "number": 103, "kind": "recipe", "legacy_title": "Hexbin 联合分布图(六边形分箱 + 边际直方图)", "legacy_ref": "competition #24", "source": { "original_code": "sources/competition.hexbin_joint/original.py", "execution_code": "sources/competition.hexbin_joint/render.py", "recipe_section": "sources/competition.hexbin_joint/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "5091cfd319229ae210b618343953e500af9df2500637df5345fa9d83005cfeee", "code_sha256": "30a1e2235d420902dfe87458ec8dff7cdbe25c61053a8a1be16ab93ec8169d72", "execution_sha256": "30a1e2235d420902dfe87458ec8dff7cdbe25c61053a8a1be16ab93ec8169d72", "code_view": "sources/competition.hexbin_joint/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.hexbin_joint-1.png", "thumbnail": "thumbnails/competition.hexbin_joint-1.jpg", "sha256": "7443a5497fdecc31e8302c3f3ffc63c9286ff753590d372d067e2e211f04f787", "pixels": [ 1260, 1260 ], "native_inches": [ 7.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "hexbin", "code": "hb = ax_main.hexbin(x, y, gridsize=25, cmap='YlOrRd', mincnt=1, edgecolors='white', linewidths=0.3)" }, { "line": 25, "operation": "plot", "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=1.8, label=f'$\\\\hat{{Y}}={z[0]:.3f}X{z[1]:+.1f}$')" }, { "line": 31, "operation": "hist", "code": "ax_top.hist(x, bins=40, color=PALETTE[0], alpha=0.5, edgecolor='white', linewidth=0.5)" }, { "line": 36, "operation": "hist", "code": "ax_right.hist(y, bins=40, orientation='horizontal', color=PALETTE[1], alpha=0.5, edgecolor='white', linewidth=0.5)" } ], "literal_colormaps": [ "YlOrRd" ], "aliases": [ "hexbin", "jointplot", "边际直方图" ], "related_ids": [ "basic.scatter_regression", "competition.scatter_regression_marginals", "competition.kde_joint", "competition.bubble_joint", "competition.bubble_kde" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.hexbin_joint.md", "fidelity_checkpoints": [ { "feature": "计数六边形与双边际", "preserve": "保留主图六边形计数、格边分隔、回归虚线和顶部/右侧浅直方;不能直接换普通散点。", "allowed_adaptation": "分箱粒度、边际分箱、回归和连续色相可变;色条仍对应计数或明确的新统计量。", "evidence": [ { "line": 20, "end_line": 20, "code": "hb = ax_main.hexbin(x, y, gridsize=25, cmap='YlOrRd', mincnt=1, edgecolors='white', linewidths=0.3)", "href": "sources/competition.hexbin_joint/original.html#L20" }, { "line": 25, "end_line": 26, "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=1.8,\n label=f'$\\\\hat{{Y}}={z[0]:.3f}X{z[1]:+.1f}$')", "href": "sources/competition.hexbin_joint/original.html#L25" }, { "line": 31, "end_line": 31, "code": "ax_top.hist(x, bins=40, color=PALETTE[0], alpha=0.5, edgecolor='white', linewidth=0.5)", "href": "sources/competition.hexbin_joint/original.html#L31" }, { "line": 36, "end_line": 37, "code": "ax_right.hist(y, bins=40, orientation='horizontal', color=PALETTE[1], alpha=0.5,\n edgecolor='white', linewidth=0.5)", "href": "sources/competition.hexbin_joint/original.html#L36" }, { "line": 44, "end_line": 44, "code": "fig.colorbar(hb, ax=ax_right, shrink=0.6, label='样本数')", "href": "sources/competition.hexbin_joint/original.html#L44" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.kde_joint", "display_name": "二维密度与双边际联合图", "tags": [ "关联", "分布", "组合" ], "purpose": "联合密度的峰形与各变量边际分布怎样?", "data_requirements": [ "逐样本配对连续x、y" ], "composition": "主图散点和KDE;上方x密度;右方y密度", "visual_features": [ "蓝色浅密度背景", "回归虚线", "透明边际面积" ], "adaptation_notes": "多峰数据的全局回归可能掩盖分群关系;区别于以频数为主的hexbin_joint。", "number": 104, "kind": "recipe", "legacy_title": "KDE 热力联合分布图(散点 + 热力图 + 边际密度)", "legacy_ref": "competition #25", "source": { "original_code": "sources/competition.kde_joint/original.py", "execution_code": "sources/competition.kde_joint/render.py", "recipe_section": "sources/competition.kde_joint/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "6832d81e6c8b4b3d6665b13562d058eacd0cd5a590797b8684255e5836b8fb69", "code_sha256": "ddcbc7f698f8b9a1f2619f66e779e4a77850a37b99c6dad2470b6687ab90cc95", "execution_sha256": "ddcbc7f698f8b9a1f2619f66e779e4a77850a37b99c6dad2470b6687ab90cc95", "code_view": "sources/competition.kde_joint/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.kde_joint-1.png", "thumbnail": "thumbnails/competition.kde_joint-1.jpg", "sha256": "79a0b6a58ddc9fbc1ed69f05151337227e57621b5ee9f89a82b95fdacf4337ff", "pixels": [ 1260, 1260 ], "native_inches": [ 7.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 26, "operation": "contourf", "code": "ax_main.contourf(Xg, Yg, Zg, levels=12, cmap='Blues', alpha=0.5)" }, { "line": 27, "operation": "scatter", "code": "ax_main.scatter(x, y, s=8, alpha=0.3, color=PALETTE[0], edgecolor='none')" }, { "line": 34, "operation": "plot", "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=2, label='回归线')" }, { "line": 35, "operation": "fill_between", "code": "ax_main.fill_between(x_line, p(x_line) - 1.96*se_line, p(x_line) + 1.96*se_line, alpha=0.15, color=PALETTE[1])" }, { "line": 43, "operation": "fill_between", "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])" }, { "line": 44, "operation": "plot", "code": "ax_top.plot(xx, kde_x(xx), color=PALETTE[0], linewidth=1.5)" }, { "line": 49, "operation": "fill_betweenx", "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])" }, { "line": 50, "operation": "plot", "code": "ax_right.plot(kde_y(yy), yy, color=PALETTE[1], linewidth=1.5)" } ], "literal_colormaps": [ "Blues" ], "aliases": [ "KDE jointplot", "联合分布", "边际密度" ], "related_ids": [ "basic.scatter_regression", "competition.scatter_regression_marginals", "competition.hexbin_joint", "competition.bubble_joint", "competition.bubble_kde" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.kde_joint.md", "fidelity_checkpoints": [ { "feature": "主图密度加回归带与边际", "preserve": "保留主图浅密度、透明散点、回归虚线与真实区间,以及两侧浅填充密度和轮廓。", "allowed_adaptation": "样本、带宽、区间计算、连续色相和边际比例可变,三个轴的数据范围需对应。", "evidence": [ { "line": 26, "end_line": 26, "code": "ax_main.contourf(Xg, Yg, Zg, levels=12, cmap='Blues', alpha=0.5)", "href": "sources/competition.kde_joint/original.html#L26" }, { "line": 27, "end_line": 27, "code": "ax_main.scatter(x, y, s=8, alpha=0.3, color=PALETTE[0], edgecolor='none')", "href": "sources/competition.kde_joint/original.html#L27" }, { "line": 34, "end_line": 34, "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=2, label='回归线')", "href": "sources/competition.kde_joint/original.html#L34" }, { "line": 35, "end_line": 36, "code": "ax_main.fill_between(x_line, p(x_line) - 1.96*se_line, p(x_line) + 1.96*se_line,\n alpha=0.15, color=PALETTE[1])", "href": "sources/competition.kde_joint/original.html#L35" }, { "line": 43, "end_line": 43, "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])", "href": "sources/competition.kde_joint/original.html#L43" }, { "line": 44, "end_line": 44, "code": "ax_top.plot(xx, kde_x(xx), color=PALETTE[0], linewidth=1.5)", "href": "sources/competition.kde_joint/original.html#L44" }, { "line": 49, "end_line": 49, "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])", "href": "sources/competition.kde_joint/original.html#L49" }, { "line": 50, "end_line": 50, "code": "ax_right.plot(kde_y(yy), yy, color=PALETTE[1], linewidth=1.5)", "href": "sources/competition.kde_joint/original.html#L50" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.scatter_regression_marginals", "display_name": "简洁回归散点与边际KDE", "tags": [ "关联", "分布", "组合" ], "purpose": "两个变量的线性关系与单变量分布怎样?", "data_requirements": [ "配对x、y原始样本" ], "composition": "中央散点回归;上方与右方密度", "visual_features": [ "稀疏透明点", "回归虚线", "浅填充边际" ], "adaptation_notes": "主图不含basic.scatter_regression的二维密度背景和回归带;适合希望主图更简洁时。", "number": 105, "kind": "recipe", "legacy_title": "散点 + 回归 + 边际密度图(通用版)", "legacy_ref": "competition #26", "source": { "original_code": "sources/competition.scatter_regression_marginals/original.py", "execution_code": "sources/competition.scatter_regression_marginals/render.py", "recipe_section": "sources/competition.scatter_regression_marginals/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "6043bed2c6fde3818ce879a93d16b5181a83df4facd4299d2453c539038ed55f", "code_sha256": "f0bf5a23521906e8718a633c5e4f4ea452a24f7102004fdb8e59795573118aa2", "execution_sha256": "f0bf5a23521906e8718a633c5e4f4ea452a24f7102004fdb8e59795573118aa2", "code_view": "sources/competition.scatter_regression_marginals/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.scatter_regression_marginals-1.png", "thumbnail": "thumbnails/competition.scatter_regression_marginals-1.jpg", "sha256": "f45ec1dba2674cf5e985a5400af24825e009be22cdf6edddec626a0e234c3673", "pixels": [ 1260, 1260 ], "native_inches": [ 7.0, 7.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "scatter", "code": "ax_main.scatter(x, y, s=15, alpha=0.4, color=PALETTE[0], edgecolor='white', linewidth=0.3)" }, { "line": 23, "operation": "plot", "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=2, label=f'y={z[0]:.2f}x{z[1]:+.1f}')" }, { "line": 29, "operation": "fill_between", "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])" }, { "line": 30, "operation": "plot", "code": "ax_top.plot(xx, kde_x(xx), color=PALETTE[0], linewidth=1.5)" }, { "line": 35, "operation": "fill_betweenx", "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])" }, { "line": 36, "operation": "plot", "code": "ax_right.plot(kde_y(yy), yy, color=PALETTE[1], linewidth=1.5)" } ], "literal_colormaps": [], "aliases": [ "jointplot", "回归与边际密度" ], "related_ids": [ "basic.scatter_regression", "competition.kde_joint", "competition.hexbin_joint", "competition.bubble_joint", "competition.bubble_kde" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.scatter_regression_marginals.md", "fidelity_checkpoints": [ { "feature": "稀疏透明点与浅边际", "preserve": "保留透明白边散点、回归虚线、顶部及右侧浅密度与深轮廓;此模板没有中央 KDE 填色。", "allowed_adaptation": "配对样本、回归、带宽和边际尺寸可变,不能为了统一风格增加无依据的统计图层。", "evidence": [ { "line": 20, "end_line": 20, "code": "ax_main.scatter(x, y, s=15, alpha=0.4, color=PALETTE[0], edgecolor='white', linewidth=0.3)", "href": "sources/competition.scatter_regression_marginals/original.html#L20" }, { "line": 23, "end_line": 23, "code": "ax_main.plot(x_line, p(x_line), '--', color=PALETTE[1], linewidth=2, label=f'y={z[0]:.2f}x{z[1]:+.1f}')", "href": "sources/competition.scatter_regression_marginals/original.html#L23" }, { "line": 29, "end_line": 29, "code": "ax_top.fill_between(xx, kde_x(xx), alpha=0.3, color=PALETTE[0])", "href": "sources/competition.scatter_regression_marginals/original.html#L29" }, { "line": 30, "end_line": 30, "code": "ax_top.plot(xx, kde_x(xx), color=PALETTE[0], linewidth=1.5)", "href": "sources/competition.scatter_regression_marginals/original.html#L30" }, { "line": 35, "end_line": 35, "code": "ax_right.fill_betweenx(yy, kde_y(yy), alpha=0.3, color=PALETTE[1])", "href": "sources/competition.scatter_regression_marginals/original.html#L35" }, { "line": 36, "end_line": 36, "code": "ax_right.plot(kde_y(yy), yy, color=PALETTE[1], linewidth=1.5)", "href": "sources/competition.scatter_regression_marginals/original.html#L36" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.cluster_3d", "display_name": "三维分组散点", "tags": [ "三维", "聚类" ], "purpose": "三维空间中的类别中心和分离程度怎样?", "data_requirements": [ "三维坐标与类别标签" ], "composition": "单3D轴;分组点云", "visual_features": [ "小透明点", "类中心文字", "类别图例" ], "adaptation_notes": "没有academic.benchmark_table的透明凸包;前后遮挡与视角影响分离观感。", "number": 106, "kind": "recipe", "legacy_title": "3D 聚类散点图(彩色分组 + 原色边框点 + 文本标注)", "legacy_ref": "competition #27", "source": { "original_code": "sources/competition.cluster_3d/original.py", "execution_code": "sources/competition.cluster_3d/render.py", "recipe_section": "sources/competition.cluster_3d/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "8c7ce9e5b00d499ea6b73b92c257615a899632d285f9608856cced6fc5f6c198", "code_sha256": "5ec93a2cccc0f1b050b3766b9487fd2fd9b54a5f3a4e20388b7ba5b950430511", "execution_sha256": "5ec93a2cccc0f1b050b3766b9487fd2fd9b54a5f3a4e20388b7ba5b950430511", "code_view": "sources/competition.cluster_3d/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.cluster_3d-1.png", "thumbnail": "thumbnails/competition.cluster_3d-1.jpg", "sha256": "0fb5abc7d221c0605b2503b2a63bc2468ed7ac36db546a754e144261f6c0c5b1", "pixels": [ 1440, 1080 ], "native_inches": [ 8.0, 6.0 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 19, "operation": "scatter", "code": " ax.scatter(X[mask,0], X[mask,1], X[mask,2], s=20, alpha=0.5, color=PALETTE[k], edgecolor='white', linewidth=0.3, label=f'簇 {k+1}')" }, { "line": 21, "operation": "scatter", "code": " ax.scatter(*centers[k], s=150, color=PALETTE[k], marker='X', edgecolor='white', linewidth=2, zorder=5)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "academic.benchmark_table", "academic.tsne_umap", "competition.kmeans" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.cluster_3d.md", "fidelity_checkpoints": [ { "feature": "三维浅点云与中心叉号", "preserve": "保留分组透明小点和同类色白边大叉中心,图例能对应每个类。", "allowed_adaptation": "样本、簇中心和视角按实际数据更新,点密度可调,不能让中心被不透明点云遮没。", "evidence": [ { "line": 19, "end_line": 20, "code": " ax.scatter(X[mask,0], X[mask,1], X[mask,2], s=20, alpha=0.5,\n color=PALETTE[k], edgecolor='white', linewidth=0.3, label=f'簇 {k+1}')", "href": "sources/competition.cluster_3d/original.html#L19" }, { "line": 21, "end_line": 22, "code": " ax.scatter(*centers[k], s=150, color=PALETTE[k], marker='X',\n edgecolor='white', linewidth=2, zorder=5)", "href": "sources/competition.cluster_3d/original.html#L21" }, { "line": 28, "end_line": 28, "code": "ax.legend(loc='upper left', fontsize=10, framealpha=0.9)", "href": "sources/competition.cluster_3d/original.html#L28" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.feasible_region", "display_name": "二维可行性分区与约束边界", "tags": [ "优化", "矩阵" ], "purpose": "哪些参数组合满足约束,解位于何处?", "data_requirements": [ "二维参数网格", "可行掩码或约束裕度", "已验证的解" ], "composition": "两类填色;零裕度边界;参考阈值线", "visual_features": [ "浅色可行与违反区域", "星形解点" ], "adaptation_notes": "原示例标注最优点的裕度为-1.7,落在违反区;参考位置不能直接复用为真实可行解。", "number": 107, "kind": "recipe", "legacy_title": "可行域图(约束满足分区 + 边界 + 最优点)", "legacy_ref": "competition #28", "source": { "original_code": "sources/competition.feasible_region/original.py", "execution_code": "sources/competition.feasible_region/render.py", "recipe_section": "sources/competition.feasible_region/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "a17b5a99dfe22cc57019b2ed9a17481ac6a47f62d0db2dba67c6c6a390930ef7", "code_sha256": "ca3f8ac55264441e5620bd626af7e30336653134bc27fb7086610696b8bd2798", "execution_sha256": "ca3f8ac55264441e5620bd626af7e30336653134bc27fb7086610696b8bd2798", "code_view": "sources/competition.feasible_region/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.feasible_region-1.png", "thumbnail": "thumbnails/competition.feasible_region-1.jpg", "sha256": "3a435897a77966d812fdaafd0bf002ed8a24f23bca59195b292e67775660885e", "pixels": [ 1188, 936 ], "native_inches": [ 6.6, 5.2 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 20, "operation": "contourf", "code": "ax.contourf(X, Y, feasible, levels=[-0.5, 0.5, 1.5], cmap=cmap2, zorder=2)" }, { "line": 22, "operation": "contour", "code": "ax.contour(X, Y, margin, levels=[0], colors=[PALETTE[0]], linewidths=2.0, zorder=4)" }, { "line": 32, "operation": "scatter", "code": "ax.scatter([opt_x], [opt_y], s=150, marker='*', color=PALETTE[4], zorder=8, edgecolors='white', linewidths=1.2)" } ], "literal_colormaps": [], "aliases": [], "related_ids": [ "competition.surface_3d", "academic.feature_importance", "competition.contour" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.feasible_region.md", "fidelity_checkpoints": [ { "feature": "两类区域与边界", "preserve": "保留离散的可行/违反区、零裕度边界、临界参考和最优星号;不能把两类区域改成无含义连续渐变。", "allowed_adaptation": "约束、网格、边界、最优点和临界值据实计算,浅色端点可随配色适配。", "evidence": [ { "line": 20, "end_line": 20, "code": "ax.contourf(X, Y, feasible, levels=[-0.5, 0.5, 1.5], cmap=cmap2, zorder=2)", "href": "sources/competition.feasible_region/original.html#L20" }, { "line": 22, "end_line": 22, "code": "ax.contour(X, Y, margin, levels=[0], colors=[PALETTE[0]], linewidths=2.0, zorder=4)", "href": "sources/competition.feasible_region/original.html#L22" }, { "line": 26, "end_line": 26, "code": "ax.axvline(p_crit, ls='--', lw=1.4, color=PALETTE[1], zorder=5)", "href": "sources/competition.feasible_region/original.html#L26" }, { "line": 32, "end_line": 33, "code": "ax.scatter([opt_x], [opt_y], s=150, marker='*', color=PALETTE[4], zorder=8,\n edgecolors='white', linewidths=1.2)", "href": "sources/competition.feasible_region/original.html#L32" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "competition.state_grid", "display_name": "离散状态时间栅格", "tags": [ "时间", "矩阵", "仿真" ], "purpose": "单元状态随帧或时隙如何切换?", "data_requirements": [ "单元×时间的离散状态编码矩阵", "类别解释" ], "composition": "每单元一行;每时隙一列", "visual_features": [ "离散色块", "细白格线", "状态色条" ], "adaptation_notes": "颜色编码类别或等级,不适合连续插值;状态0可能代表成功而非无数据。", "number": 108, "kind": "recipe", "legacy_title": "离散状态栅格图(仿真逐帧/逐时隙状态热图)", "legacy_ref": "competition #29", "source": { "original_code": "sources/competition.state_grid/original.py", "execution_code": "sources/competition.state_grid/render.py", "recipe_section": "sources/competition.state_grid/recipe.md", "recipe_file": "figure_recipes_competition.md", "content_sha256": "08597a18e66847b97224c9e11a48677c1e0cf62132ef6d852d6ff2ecc226ee60", "code_sha256": "060164c197f6e117211799340e72265a1a1339701710faf85578b70c43f06126", "execution_sha256": "060164c197f6e117211799340e72265a1a1339701710faf85578b70c43f06126", "code_view": "sources/competition.state_grid/original.html" }, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "first_main_python_block", "previews": [ { "path": "previews/competition.state_grid-1.png", "thumbnail": "thumbnails/competition.state_grid-1.jpg", "sha256": "d232682aad16949fed85b90e30412927dcfb3cc50cbbf367d701f93873924af2", "pixels": [ 1296, 792 ], "native_inches": [ 7.2, 4.4 ], "palette": [ "#606C38", "#DDA15E", "#BC6C25", "#4A5A2B", "#A68A64", "#7F4F24", "#936639" ] } ], "code_evidence": [ { "line": 23, "operation": "pcolormesh", "code": "pc = ax.pcolormesh(np.arange(n_frame + 1) - 0.5, np.arange(n_unit + 1) - 0.5, np.ma.masked_invalid(Z), cmap=CMAP, norm=NORM, edgecolors='white', linewidth=0.30, zorder=3)" } ], "literal_colormaps": [], "aliases": [ "state grid", "状态矩阵", "时隙仿真" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/competition.state_grid.md", "fidelity_checkpoints": [ { "feature": "离散状态与格子边界", "preserve": "保留离散状态颜色、细白格线、整数状态色条及缺失遮罩,不用连续渐变暗示状态之间存在插值。", "allowed_adaptation": "单元、时隙、状态数量和类别颜色可变;每个色条标签对应同一离散状态。", "evidence": [ { "line": 23, "end_line": 25, "code": "pc = ax.pcolormesh(np.arange(n_frame + 1) - 0.5, np.arange(n_unit + 1) - 0.5,\n np.ma.masked_invalid(Z), cmap=CMAP, norm=NORM,\n edgecolors='white', linewidth=0.30, zorder=3)", "href": "sources/competition.state_grid/original.html#L23" }, { "line": 27, "end_line": 27, "code": "cb = fig.colorbar(pc, ax=ax, shrink=0.82, aspect=16, pad=0.03, ticks=[0, 1, 2, 3])", "href": "sources/competition.state_grid/original.html#L27" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "template.sem_violin_pearson", "display_name": "残差小提琴与Pearson完整组合", "tags": [ "关联", "分布", "多维", "组合" ], "purpose": "问卷构念的残差分布和两两关系如何并置展示?", "data_requirements": [ "逐受访者题项或构念分数", "题项到构念映射", "构念顺序" ], "composition": "左侧横向残差小提琴;右侧Pearson成对矩阵;外侧色条", "visual_features": [ "统一青蓝透明琴体和散点", "深轮廓", "对角直方", "上三角相关与星号", "整体对齐" ], "adaptation_notes": "原脚本直接复用;残差为各构念对其他构念OLS残差,非SEM路径残差;默认1–7量表及残差范围±2.8;色条两端同色。", "number": 109, "kind": "complete_template", "legacy_title": "小提琴 + Pearson 完整组合模板", "legacy_ref": null, "title_mismatch": false, "compatibility_patches": [], "preview_scope": "combined_output", "source": { "original_code": "sources/template.sem_violin_pearson/original.py", "template_description": "sources/template.sem_violin_pearson/template-original.md", "code_sha256": "30648b826cbb67a3e917e80de739d1bbeb9bc11a5865a6f0f9b9b0fed3b0e6a0", "code_view": "sources/template.sem_violin_pearson/original.html" }, "previews": [ { "path": "previews/template.sem_violin_pearson-1.png", "thumbnail": "thumbnails/template.sem_violin_pearson-1.jpg", "sha256": "e73bb92481bc1b354de118aad20b63e9c0ff398eb94ec07709ab4c5d9f41cd79", "pixels": [ 7306, 4093 ] } ], "code_evidence": [ { "line": 208, "operation": "violinplot", "code": " sns.violinplot( data=long, y=\"Variable\", x=\"Residual\"," }, { "line": 226, "operation": "scatter", "code": " ax.scatter(vals, rng.normal(yi, 0.055, len(vals)), s=11, color=dot, alpha=0.28, edgecolors=\"none\", zorder=3)" }, { "line": 257, "operation": "hist", "code": " ax.hist(vals, bins=np.arange(1, 8.5, 0.5), color=\"#CBEFC9\", edgecolor=\"#6FAB74\", linewidth=1.0)" }, { "line": 267, "operation": "scatter", "code": " ax.scatter(scored[col], scored[row], s=10, color=\"#2BB8C6\", alpha=0.34, edgecolors=\"none\")" } ], "literal_colormaps": [], "aliases": [ "violin Pearson", "pairgrid", "问卷构念", "残差分布与相关关系", "小提琴相关矩阵组合", "左右组合" ], "related_ids": [ "advanced.pair_plot", "empirical.correlation_heatmap", "competition.correlation_matrix", "basic.heatmap" ], "review": { "visual": "main_preview_inspected", "code": "plotting_and_data_sections_checked", "statistical_audit": false }, "card_path": "cards/template.sem_violin_pearson.md", "fidelity_checkpoints": [ { "feature": "完整组合的对齐和透明层", "preserve": "保留左横向残差小提琴与散点的透明层、深轮廓,右侧对角直方/下三角散点/上三角相关的分工,以及整体拼合与外侧色条。直接以完整组合代码适配。", "allowed_adaptation": "变量与样本数、列宽和输出尺寸可变,量表/残差定义与相关检验按模板专用说明适配;默认样式及换色遵循该组合的专用说明。", "evidence": [ { "line": 208, "end_line": 219, "code": " sns.violinplot(\n data=long,\n y=\"Variable\",\n x=\"Residual\",\n order=order,\n orient=\"h\",\n inner=None,\n color=fill,\n linewidth=1.8,\n cut=0,\n ax=ax,\n )", "href": "sources/template.sem_violin_pearson/original.html#L208" }, { "line": 222, "end_line": 222, "code": " collection.set_alpha(0.75)", "href": "sources/template.sem_violin_pearson/original.html#L222" }, { "line": 226, "end_line": 226, "code": " ax.scatter(vals, rng.normal(yi, 0.055, len(vals)), s=11, color=dot, alpha=0.28, edgecolors=\"none\", zorder=3)", "href": "sources/template.sem_violin_pearson/original.html#L226" }, { "line": 257, "end_line": 257, "code": " ax.hist(vals, bins=np.arange(1, 8.5, 0.5), color=\"#CBEFC9\", edgecolor=\"#6FAB74\", linewidth=1.0)", "href": "sources/template.sem_violin_pearson/original.html#L257" }, { "line": 267, "end_line": 267, "code": " ax.scatter(scored[col], scored[row], s=10, color=\"#2BB8C6\", alpha=0.34, edgecolors=\"none\")", "href": "sources/template.sem_violin_pearson/original.html#L267" }, { "line": 272, "end_line": 272, "code": " ax.set_facecolor(cmap(norm(value)))", "href": "sources/template.sem_violin_pearson/original.html#L272" }, { "line": 298, "end_line": 298, "code": " cb = fig.colorbar(ScalarMappable(norm=norm, cmap=cmap), cax=cax)", "href": "sources/template.sem_violin_pearson/original.html#L298" } ] } ], "fidelity_scope": "当前主要示例;源码行定位已核对,适配后仍需对照实图。不是统计认证或自动通过条件。" }, { "id": "screenshot.fan_violin_heatmap", "display_name": "扇形小提琴与热图", "tags": [ "分布", "矩阵", "极坐标", "组合" ], "purpose": "半圆热图、小提琴分布、外圈刻度与色标,用于各类别的样本分布,以及类别×指标数值矩阵的展示。", "data_requirements": [ "各类别的样本分布,以及类别×指标数值矩阵" ], "composition": "半圆热图、小提琴分布、外圈刻度与色标", "visual_features": [ "半圆热图", "小提琴分布", "外圈刻度与色标" ], "adaptation_notes": "仅效果图,按图重建。仅有截图006效果图,未提供代码;按图重建扇形热图、KDE小提琴与四分位线,附可重复合成数据。 径向年份隔项显示并旋转,避免重叠;保留每一个热图环。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 110, "kind": "recipe", "legacy_title": "扇形小提琴与热图", "legacy_ref": "screenshot #1", "source": { "original_code": "sources/screenshot.fan_violin_heatmap/restored.py", "execution_code": "sources/screenshot.fan_violin_heatmap/restored.py", "recipe_section": "sources/screenshot.fan_violin_heatmap/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "01d320e426d991408b5d4a724bedb86e0345e3b43b3f88f7716798694b489876", "code_sha256": "c8df6d2e9ac1e3ca1da60412309845d0c50354fa51ef35f7525698e20bbffc13", "execution_sha256": "c8df6d2e9ac1e3ca1da60412309845d0c50354fa51ef35f7525698e20bbffc13", "code_view": "sources/screenshot.fan_violin_heatmap/restored.html", "provenance": "sources/screenshot.fan_violin_heatmap/provenance.json", "source_status": "image_only", "figure_page": 6, "code_pages": [], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "仅有截图006效果图,未提供代码;按图重建扇形热图、KDE小提琴与四分位线,附可重复合成数据。", "径向年份隔项显示并旋转,避免重叠;保留每一个热图环。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.fan_violin_heatmap-1.png", "thumbnail": "thumbnails/screenshot.fan_violin_heatmap-1.jpg", "sha256": "558cf645bb8e11ba2eaaa11280d47d710593c4a067e701a11a521cf0dbf4e294", "pixels": [ 1452, 1203 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 32, "operation": "pcolormesh", "code": "ax.pcolormesh(theta_edges,r_edges,heat[:,::-1],cmap=cmap,norm=norm,edgecolors='#ffffff88',linewidth=.5,shading='flat',alpha=.85)" }, { "line": 39, "operation": "fill", "code": "ax.fill(np.r_[theta-halfwidth,(theta+halfwidth)[::-1]],np.r_[radial,radial[::-1]],color=cmap(norm(np.median(values))),alpha=.85,edgecolor='#ffffff',linewidth=.6)" }, { "line": 42, "operation": "plot", "code": "ax.plot([theta-w,theta+w],[.83+(q-.2)/.5*.35]*2,color='white',linestyle='--',linewidth=1.1)" }, { "line": 47, "operation": "text", "code": "ax.text(np.pi+.05,(r_edges[i]+r_edges[i+1])/2,str(years[i]),fontsize=8,color='#777777',rotation=55,ha='right',va='top',clip_on=False)" }, { "line": 50, "operation": "colorbar", "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,orientation='vertical',fraction=.035,pad=.07,shrink=.65)" } ], "literal_colormaps": [], "aliases": [ "fan_violin_heatmap", "新图1", "截图6" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.fan_violin_heatmap.md", "fidelity_checkpoints": [ { "title": "扇形小提琴与热图的完整视觉结构", "preserve": "半圆热图、小提琴分布、外圈刻度与色标;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "各类别的样本分布,以及类别×指标数值矩阵;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 32, "end_line": 32, "code": "ax.pcolormesh(theta_edges,r_edges,heat[:,::-1],cmap=cmap,norm=norm,edgecolors='#ffffff88',linewidth=.5,shading='flat',alpha=.85)", "href": "sources/screenshot.fan_violin_heatmap/restored.html#L32" }, { "line": 39, "end_line": 39, "code": " ax.fill(np.r_[theta-halfwidth,(theta+halfwidth)[::-1]],np.r_[radial,radial[::-1]],color=cmap(norm(np.median(values))),alpha=.85,edgecolor='#ffffff',linewidth=.6)", "href": "sources/screenshot.fan_violin_heatmap/restored.html#L39" }, { "line": 42, "end_line": 42, "code": " ax.plot([theta-w,theta+w],[.83+(q-.2)/.5*.35]*2,color='white',linestyle='--',linewidth=1.1)", "href": "sources/screenshot.fan_violin_heatmap/restored.html#L42" }, { "line": 47, "end_line": 47, "code": " ax.text(np.pi+.05,(r_edges[i]+r_edges[i+1])/2,str(years[i]),fontsize=8,color='#777777',rotation=55,ha='right',va='top',clip_on=False)", "href": "sources/screenshot.fan_violin_heatmap/restored.html#L47" }, { "line": 50, "end_line": 50, "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,orientation='vertical',fraction=.035,pad=.07,shrink=.65)", "href": "sources/screenshot.fan_violin_heatmap/restored.html#L50" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.layered_area_3d", "display_name": "三维分层面积图", "tags": [ "三维", "趋势", "分布" ], "purpose": "透明层叠面积、平滑曲线、三维轴与深色轮廓,用于有序 x 和多个情景数值序列的展示。", "data_requirements": [ "有序 x 和多个情景数值序列" ], "composition": "透明层叠面积、平滑曲线、三维轴与深色轮廓", "visual_features": [ "透明层叠面积", "平滑曲线", "三维轴与深色轮廓" ], "adaptation_notes": "部分代码恢复,缺失段按图补全。仅有007的CSV读取和函数起始页;保留可见读取函数,绘图部分按009效果图重建。 原CSV未附带,示例水位为手工合成;统一900m基座、六层透明填充与独立轮廓。", "number": 111, "kind": "recipe", "legacy_title": "三维分层面积图", "legacy_ref": "screenshot #2", "source": { "original_code": "sources/screenshot.layered_area_3d/restored.py", "execution_code": "sources/screenshot.layered_area_3d/restored.py", "recipe_section": "sources/screenshot.layered_area_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "0e822547e47650f12069d21e948047bd240f7b1c3736fa6d1260fee8e9810890", "code_sha256": "b9a23c4f7ed58d55e1d4b251a15b46c44d63636df0b7a7a528fbfc4ad80e37a7", "execution_sha256": "b9a23c4f7ed58d55e1d4b251a15b46c44d63636df0b7a7a528fbfc4ad80e37a7", "code_view": "sources/screenshot.layered_area_3d/restored.html", "provenance": "sources/screenshot.layered_area_3d/provenance.json", "source_status": "partial_code", "figure_page": 9, "code_pages": [ 7 ] }, "title_mismatch": false, "compatibility_patches": [ "仅有007的CSV读取和函数起始页;保留可见读取函数,绘图部分按009效果图重建。", "原CSV未附带,示例水位为手工合成;统一900m基座、六层透明填充与独立轮廓。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.layered_area_3d-1.png", "thumbnail": "thumbnails/screenshot.layered_area_3d-1.jpg", "sha256": "a5115236952dc9139fd30c0b2ad5876fe8e1352e04dfb31c074102c9d7d7e134", "pixels": [ 1108, 1108 ] } ], "code_evidence": [ { "line": 53, "operation": "PolyCollection", "code": "PolyCollection([vertices],facecolors=color,alpha=.32,edgecolors='none')" }, { "line": 55, "operation": "plot", "code": "ax.plot(x_smooth,np.full(len(x_smooth),i+1),y_smooth,color=color,linewidth=2.5)" } ], "literal_colormaps": [], "aliases": [ "layered_area_3d", "新图2", "截图9" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.layered_area_3d.md", "fidelity_checkpoints": [ { "title": "三维分层面积图的完整视觉结构", "preserve": "透明层叠面积、平滑曲线、三维轴与深色轮廓;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "有序 x 和多个情景数值序列;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 53, "end_line": 53, "code": " poly=PolyCollection([vertices],facecolors=color,alpha=.32,edgecolors='none')", "href": "sources/screenshot.layered_area_3d/restored.html#L53" }, { "line": 55, "end_line": 55, "code": " ax.plot(x_smooth,np.full(len(x_smooth),i+1),y_smooth,color=color,linewidth=2.5)", "href": "sources/screenshot.layered_area_3d/restored.html#L55" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.heatmap_slabs_3d", "display_name": "三维分层热图", "tags": [ "三维", "矩阵", "组合" ], "purpose": "多层热图平面、共享发散色标、单元格与三维轴,用于同形状的多层数值矩阵的展示。", "data_requirements": [ "同形状的多层数值矩阵" ], "composition": "多层热图平面、共享发散色标、单元格与三维轴", "visual_features": [ "多层热图平面", "共享发散色标", "单元格与三维轴" ], "adaptation_notes": "仅效果图,按图重建。仅有010效果图(署名 @Doc mm),整段实现按视觉结构重建;矩阵是固定种子的合成数据。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 112, "kind": "recipe", "legacy_title": "三维分层热图", "legacy_ref": "screenshot #3", "source": { "original_code": "sources/screenshot.heatmap_slabs_3d/restored.py", "execution_code": "sources/screenshot.heatmap_slabs_3d/restored.py", "recipe_section": "sources/screenshot.heatmap_slabs_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "6a3c43883bfce18965ccd97b91f011fe7a1dad85e2e27d3cb4dc9b307e6cda3a", "code_sha256": "68c67e3f6f1aa98dc4f275d8a8c2130094982a31c56f16cf405f15927bc55662", "execution_sha256": "68c67e3f6f1aa98dc4f275d8a8c2130094982a31c56f16cf405f15927bc55662", "code_view": "sources/screenshot.heatmap_slabs_3d/restored.html", "provenance": "sources/screenshot.heatmap_slabs_3d/provenance.json", "source_status": "image_only", "figure_page": 10, "code_pages": [], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "仅有010效果图(署名 @Doc mm),整段实现按视觉结构重建;矩阵是固定种子的合成数据。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.heatmap_slabs_3d-1.png", "thumbnail": "thumbnails/screenshot.heatmap_slabs_3d-1.jpg", "sha256": "7a4e15af235104407bed3cf6789c327b435300face2e7b245d4469c3911f3a5b", "pixels": [ 1479, 1238 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 32, "operation": "Poly3DCollection", "code": "slab=Poly3DCollection(verts,facecolors=facecolors,edgecolors='#dddddd',linewidths=.4,alpha=.86)" }, { "line": 38, "operation": "colorbar", "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,fraction=.035,pad=.06,shrink=.7)" } ], "literal_colormaps": [], "aliases": [ "heatmap_slabs_3d", "新图3", "截图10" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.heatmap_slabs_3d.md", "fidelity_checkpoints": [ { "title": "三维分层热图的完整视觉结构", "preserve": "多层热图平面、共享发散色标、单元格与三维轴;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "同形状的多层数值矩阵;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 32, "end_line": 32, "code": " slab=Poly3DCollection(verts,facecolors=facecolors,edgecolors='#dddddd',linewidths=.4,alpha=.86)", "href": "sources/screenshot.heatmap_slabs_3d/restored.html#L32" }, { "line": 38, "end_line": 38, "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,fraction=.035,pad=.06,shrink=.7)", "href": "sources/screenshot.heatmap_slabs_3d/restored.html#L38" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.sunburst", "display_name": "多层旭日图", "tags": [ "层级", "组成", "极坐标" ], "purpose": "多层扇区、白色分界、标签与根节点百分比,用于labels、parents、values 树形表的展示。", "data_requirements": [ "labels、parents、values 树形表;节点唯一且无环" ], "composition": "多层扇区、白色分界、标签与根节点百分比", "visual_features": [ "多层扇区", "白色分界", "标签与根节点百分比" ], "adaptation_notes": "代码截图恢复与适配。从012–013恢复树形演示数据和Plotly Sunburst;取消演示时向当前目录写出data.csv的副作用。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 113, "kind": "recipe", "legacy_title": "多层旭日图", "legacy_ref": "screenshot #4", "source": { "original_code": "sources/screenshot.sunburst/restored.py", "execution_code": "sources/screenshot.sunburst/restored.py", "recipe_section": "sources/screenshot.sunburst/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "27452ced9c827f4c7563ecf536c3159be77f47a0461719a2887a1a75cee61048", "code_sha256": "9980fa5fd7423c081536906bc2182aa461566695e7779ae292f405057bedfad9", "execution_sha256": "9980fa5fd7423c081536906bc2182aa461566695e7779ae292f405057bedfad9", "code_view": "sources/screenshot.sunburst/restored.html", "provenance": "sources/screenshot.sunburst/provenance.json", "source_status": "code", "figure_page": 11, "code_pages": [ 12, 13 ] }, "title_mismatch": false, "compatibility_patches": [ "从012–013恢复树形演示数据和Plotly Sunburst;取消演示时向当前目录写出data.csv的副作用。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.sunburst-1.png", "thumbnail": "thumbnails/screenshot.sunburst-1.jpg", "sha256": "825d823dce30851f627734edd9a1495ab6238165a9e69a04424db2bbd26c3c0b", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 26, "operation": "Sunburst", "code": "go.Sunburst(labels=data_df.labels,parents=data_df.parents,values=data_df['values'],\n textinfo='label+percent root',textfont=dict(color='white',size=14),\n marker=dict(colors=['#ffffff','#f9b99e','#f87f8c','#e37e8e','#a9758c','#796b88'],line=dict(color='white',width=3)))" } ], "literal_colormaps": [], "aliases": [ "sunburst", "新图4", "截图11" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.sunburst.md", "fidelity_checkpoints": [ { "title": "多层旭日图的完整视觉结构", "preserve": "多层扇区、白色分界、标签与根节点百分比;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "labels、parents、values 树形表;节点唯一且无环;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 26, "end_line": 28, "code": "fig = go.Figure(go.Sunburst(labels=data_df.labels,parents=data_df.parents,values=data_df['values'],\n textinfo='label+percent root',textfont=dict(color='white',size=14),\n marker=dict(colors=['#ffffff','#f9b99e','#f87f8c','#e37e8e','#a9758c','#796b88'],line=dict(color='white',width=3))))", "href": "sources/screenshot.sunburst/restored.html#L26" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.peak_stacked_area", "display_name": "峰值标注堆叠面积图", "tags": [ "趋势", "组成", "注释" ], "purpose": "累计面积、白色边界、顶层峰值空心标记及数值,用于有序 x 和多条非负序列的展示。", "data_requirements": [ "有序 x 和多条非负序列" ], "composition": "累计面积、白色边界、顶层峰值空心标记及数值", "visual_features": [ "累计面积", "白色边界", "顶层峰值空心标记及数值" ], "adaptation_notes": "代码截图恢复与适配。恢复多峰合成、累计面积、白边、空心峰值点和注释。 显式设定效果图的白色背景;演示图例移至上方。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 114, "kind": "recipe", "legacy_title": "峰值标注堆叠面积图", "legacy_ref": "screenshot #5", "source": { "original_code": "sources/screenshot.peak_stacked_area/restored.py", "execution_code": "sources/screenshot.peak_stacked_area/restored.py", "recipe_section": "sources/screenshot.peak_stacked_area/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "671513ff83d8e12a1cacdfa834b359da49ade2bcba0eb2aa8e6512b79e20dc4c", "code_sha256": "010c3d1bbeb9ddf35982ffb77d9399f475ae56d17b993c810d85f4b2e54beffb", "execution_sha256": "010c3d1bbeb9ddf35982ffb77d9399f475ae56d17b993c810d85f4b2e54beffb", "code_view": "sources/screenshot.peak_stacked_area/restored.html", "provenance": "sources/screenshot.peak_stacked_area/provenance.json", "source_status": "code", "figure_page": 14, "code_pages": [ 17, 18, 19, 20, 21 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复多峰合成、累计面积、白边、空心峰值点和注释。", "显式设定效果图的白色背景;演示图例移至上方。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.peak_stacked_area-1.png", "thumbnail": "thumbnails/screenshot.peak_stacked_area-1.jpg", "sha256": "b5e516d2ddb297739444ecb85b5a4703d337f3881e974abd30bf3f3e7f5eeb9b", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 44, "operation": "Scatter", "code": "go.Scatter(x=x,y=data[cat],fill='tonexty',mode='none',name=cat,fillcolor=color,stackgroup='one')" } ], "literal_colormaps": [], "aliases": [ "peak_stacked_area", "新图5", "截图14" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.peak_stacked_area.md", "fidelity_checkpoints": [ { "title": "峰值标注堆叠面积图的完整视觉结构", "preserve": "累计面积、白色边界、顶层峰值空心标记及数值;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "有序 x 和多条非负序列;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 44, "end_line": 44, "code": " fig.add_trace(go.Scatter(x=x,y=data[cat],fill='tonexty',mode='none',name=cat,fillcolor=color,stackgroup='one'))", "href": "sources/screenshot.peak_stacked_area/restored.html#L44" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.triangle_heatmap", "display_name": "双指标三角热图", "tags": [ "矩阵", "比较", "双指标" ], "purpose": "每格双三角、独立色标、数值文本、透明填充和白边,用于形状及行列标签一致的两张矩阵的展示。", "data_requirements": [ "形状及行列标签一致的两张矩阵" ], "composition": "每格双三角、独立色标、数值文本、透明填充和白边", "visual_features": [ "每格双三角", "独立色标", "数值文本", "透明填充和白边" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 115, "kind": "recipe", "legacy_title": "双指标三角热图", "legacy_ref": "screenshot #6", "source": { "original_code": "sources/screenshot.triangle_heatmap/restored.py", "execution_code": "sources/screenshot.triangle_heatmap/restored.py", "recipe_section": "sources/screenshot.triangle_heatmap/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "1ff5f799fb03fa13e29ad5d2293eda2ecbf2c876910077205622b6adc0077b27", "code_sha256": "5b5fc5ffe3c2c259bb814ebac8ce4bcd1aec39979cc8a2d71dd87099b716f9ae", "execution_sha256": "5b5fc5ffe3c2c259bb814ebac8ce4bcd1aec39979cc8a2d71dd87099b716f9ae", "code_view": "sources/screenshot.triangle_heatmap/restored.html", "provenance": "sources/screenshot.triangle_heatmap/provenance.json", "source_status": "code", "figure_page": 22, "code_pages": [ 23, 24, 25, 26 ], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.triangle_heatmap-1.png", "thumbnail": "thumbnails/screenshot.triangle_heatmap-1.jpg", "sha256": "ee65b30b94a15768129a65cb9dca980f1bcbe7bf32437409a7da2208f8f25cbf", "pixels": [ 2170, 1087 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 48, "operation": "Polygon", "code": "ax.add_patch(Polygon([[j,i],[j+1,i],[j,i+1]],facecolor=upper_cmap(norm(upper_data[i,j])),edgecolor='white',linewidth=.5,alpha=color_alpha))" }, { "line": 49, "operation": "text", "code": "ax.text(j+.1,i+.4,f'{upper_data[i,j]:g}',fontsize=7,fontweight='bold',color=get_text_color(upper_data[i,j],100,upper_color_list))" }, { "line": 57, "operation": "colorbar", "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),cax=fig.add_axes(bounds),orientation='horizontal',alpha=color_alpha)" } ], "literal_colormaps": [], "aliases": [ "triangle_heatmap", "新图6", "截图22" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.triangle_heatmap.md", "fidelity_checkpoints": [ { "title": "双指标三角热图的完整视觉结构", "preserve": "每格双三角、独立色标、数值文本、透明填充和白边;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "形状及行列标签一致的两张矩阵;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 48, "end_line": 48, "code": " ax.add_patch(Polygon([[j,i],[j+1,i],[j,i+1]],facecolor=upper_cmap(norm(upper_data[i,j])),edgecolor='white',linewidth=.5,alpha=color_alpha))", "href": "sources/screenshot.triangle_heatmap/restored.html#L48" }, { "line": 49, "end_line": 49, "code": " ax.text(j+.1,i+.4,f'{upper_data[i,j]:g}',fontsize=7,fontweight='bold',color=get_text_color(upper_data[i,j],100,upper_color_list))", "href": "sources/screenshot.triangle_heatmap/restored.html#L49" }, { "line": 57, "end_line": 57, "code": " cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),cax=fig.add_axes(bounds),orientation='horizontal',alpha=color_alpha)", "href": "sources/screenshot.triangle_heatmap/restored.html#L57" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.cone_vortex", "display_name": "三维涡旋向量图", "tags": [ "三维", "向量场" ], "purpose": "三维锥体方向、速度色阶、场景背景与长宽比,用于x、y、z、u、v、w 六列的展示。", "data_requirements": [ "x、y、z、u、v、w 六列;坐标和向量单位明确" ], "composition": "三维锥体方向、速度色阶、场景背景与长宽比", "visual_features": [ "三维锥体方向", "速度色阶", "场景背景与长宽比" ], "adaptation_notes": "代码截图恢复,原数据缺失。vortex.csv未提供,005/029只是部分数值截图;默认改用明确标注的解析涡旋合成场。 原代码sizeref=60依赖原向量单位;演示场用1.3。真实数据须按单位调整。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 116, "kind": "recipe", "legacy_title": "三维涡旋向量图", "legacy_ref": "screenshot #7", "source": { "original_code": "sources/screenshot.cone_vortex/restored.py", "execution_code": "sources/screenshot.cone_vortex/restored.py", "recipe_section": "sources/screenshot.cone_vortex/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "e71896825b8e73ff1edbe528190ba9eaf742098303e8eb54935b46aa14d5e8c3", "code_sha256": "26eda8470101679f0b1143e00ff293671e2f57530ab933a4233882471f78b184", "execution_sha256": "26eda8470101679f0b1143e00ff293671e2f57530ab933a4233882471f78b184", "code_view": "sources/screenshot.cone_vortex/restored.html", "provenance": "sources/screenshot.cone_vortex/provenance.json", "source_status": "missing_data", "figure_page": 27, "code_pages": [ 28 ] }, "title_mismatch": false, "compatibility_patches": [ "vortex.csv未提供,005/029只是部分数值截图;默认改用明确标注的解析涡旋合成场。", "原代码sizeref=60依赖原向量单位;演示场用1.3。真实数据须按单位调整。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.cone_vortex-1.png", "thumbnail": "thumbnails/screenshot.cone_vortex-1.jpg", "sha256": "08ec60064332f225a097fb97cda59a346bf5ea6c1cdbe0a5bd7eaed8371b576e", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 26, "operation": "Cone", "code": "go.Cone(x=df.x,y=df.y,z=df.z,u=df.u,v=df.v,w=df.w,\n colorscale=['#ffffff','#e9d1ab','#c3476a'],sizemode='absolute',sizeref=1.3)" } ], "literal_colormaps": [], "aliases": [ "cone_vortex", "新图7", "截图27" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.cone_vortex.md", "fidelity_checkpoints": [ { "title": "三维涡旋向量图的完整视觉结构", "preserve": "三维锥体方向、速度色阶、场景背景与长宽比;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "x、y、z、u、v、w 六列;坐标和向量单位明确;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 26, "end_line": 27, "code": "fig=go.Figure(go.Cone(x=df.x,y=df.y,z=df.z,u=df.u,v=df.v,w=df.w,\n colorscale=['#ffffff','#e9d1ab','#c3476a'],sizemode='absolute',sizeref=1.3))", "href": "sources/screenshot.cone_vortex/restored.html#L26" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.isosurface", "display_name": "三维等值面", "tags": [ "三维", "标量场" ], "purpose": "五层等值面、开口截面、连续色标与坐标壁,用于三维规则网格与每个网格点的标量的展示。", "data_requirements": [ "三维规则网格与每个网格点的标量" ], "composition": "五层等值面、开口截面、连续色标与坐标壁", "visual_features": [ "五层等值面", "开口截面", "连续色标与坐标壁" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 117, "kind": "recipe", "legacy_title": "三维等值面", "legacy_ref": "screenshot #8", "source": { "original_code": "sources/screenshot.isosurface/restored.py", "execution_code": "sources/screenshot.isosurface/restored.py", "recipe_section": "sources/screenshot.isosurface/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "d248851825b0568571a314e95fceca619786acb1260173dc1a34796a88d6127f", "code_sha256": "dc125f7642e3eb6933b8068ee18a9f69d7703e897112143975d254fb068b7e6a", "execution_sha256": "dc125f7642e3eb6933b8068ee18a9f69d7703e897112143975d254fb068b7e6a", "code_view": "sources/screenshot.isosurface/restored.html", "provenance": "sources/screenshot.isosurface/provenance.json", "source_status": "code", "figure_page": 30, "code_pages": [ 31 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.isosurface-1.png", "thumbnail": "thumbnails/screenshot.isosurface-1.jpg", "sha256": "46d89c2a7a54a59a2a19961c09a32758ccd69ed96275597c9e4f9309dbf5a8ef", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 20, "operation": "Isosurface", "code": "go.Isosurface(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),value=values.flatten(),\n isomin=10,isomax=50,colorscale=[[0.,'#2f648e'],[.5,'#e9d1ab'],[1.,'#c3476a']],\n surface_count=5,colorbar_nticks=5,caps=dict(x_show=False,y_show=False))" } ], "literal_colormaps": [], "aliases": [ "isosurface", "新图8", "截图30" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.isosurface.md", "fidelity_checkpoints": [ { "title": "三维等值面的完整视觉结构", "preserve": "五层等值面、开口截面、连续色标与坐标壁;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "三维规则网格与每个网格点的标量;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 20, "end_line": 22, "code": "fig=go.Figure(go.Isosurface(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),value=values.flatten(),\n isomin=10,isomax=50,colorscale=[[0.,'#2f648e'],[.5,'#e9d1ab'],[1.,'#c3476a']],\n surface_count=5,colorbar_nticks=5,caps=dict(x_show=False,y_show=False)))", "href": "sources/screenshot.isosurface/restored.html#L20" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.spiral_bubbles_3d", "display_name": "三维螺旋气泡", "tags": [ "三维", "散点", "多维" ], "purpose": "半透明气泡、大小与连续色彩编码、三维轨迹,用于x、y、z 与非负气泡大小变量的展示。", "data_requirements": [ "x、y、z 与非负气泡大小变量" ], "composition": "半透明气泡、大小与连续色彩编码、三维轨迹", "visual_features": [ "半透明气泡", "大小与连续色彩编码", "三维轨迹" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 118, "kind": "recipe", "legacy_title": "三维螺旋气泡", "legacy_ref": "screenshot #9", "source": { "original_code": "sources/screenshot.spiral_bubbles_3d/restored.py", "execution_code": "sources/screenshot.spiral_bubbles_3d/restored.py", "recipe_section": "sources/screenshot.spiral_bubbles_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "3511402eef2bae5909ee587d3b4cdeaa23f54d2ed6a319802d9d98d44cbff564", "code_sha256": "16ed7bba2b7589137d10dcca597cd942838a1cfc15e174833713a53a21214be5", "execution_sha256": "16ed7bba2b7589137d10dcca597cd942838a1cfc15e174833713a53a21214be5", "code_view": "sources/screenshot.spiral_bubbles_3d/restored.html", "provenance": "sources/screenshot.spiral_bubbles_3d/provenance.json", "source_status": "code", "figure_page": 32, "code_pages": [ 33, 34 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.spiral_bubbles_3d-1.png", "thumbnail": "thumbnails/screenshot.spiral_bubbles_3d-1.jpg", "sha256": "2f128e23552f16d9608ffb00489d0d22dff74a53bd2e74ed843c8d5347f09290", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 26, "operation": "Scatter3d", "code": "go.Scatter3d(x=x,y=y,z=z,mode='markers',marker=dict(size=bubble_sizes,color=z,\n colorscale=[[0.,'#2f648e'],[.5,'#e9d1ab'],[1.,'#c3476a']],opacity=.7,colorbar=dict(title='Z 值')))" } ], "literal_colormaps": [], "aliases": [ "spiral_bubbles_3d", "新图9", "截图32" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.spiral_bubbles_3d.md", "fidelity_checkpoints": [ { "title": "三维螺旋气泡的完整视觉结构", "preserve": "半透明气泡、大小与连续色彩编码、三维轨迹;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "x、y、z 与非负气泡大小变量;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 26, "end_line": 27, "code": "fig=go.Figure(go.Scatter3d(x=x,y=y,z=z,mode='markers',marker=dict(size=bubble_sizes,color=z,\n colorscale=[[0.,'#2f648e'],[.5,'#e9d1ab'],[1.,'#c3476a']],opacity=.7,colorbar=dict(title='Z 值'))))", "href": "sources/screenshot.spiral_bubbles_3d/restored.html#L26" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.volume", "display_name": "三维体绘制", "tags": [ "三维", "标量场", "透明叠加" ], "purpose": "低透明度多层体表面、连续色阶与深度叠加,用于三维网格上的标量场的展示。", "data_requirements": [ "三维网格上的标量场" ], "composition": "低透明度多层体表面、连续色阶与深度叠加", "visual_features": [ "低透明度多层体表面", "连续色阶与深度叠加" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 119, "kind": "recipe", "legacy_title": "三维体绘制", "legacy_ref": "screenshot #10", "source": { "original_code": "sources/screenshot.volume/restored.py", "execution_code": "sources/screenshot.volume/restored.py", "recipe_section": "sources/screenshot.volume/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "1eaed8b4aee65546793b64b332bdb1e216b7dbe5959eac9bc86a03336d0f09d2", "code_sha256": "36df5f48ec0ac182d7d57c4ea855f980575d06bc154a8baeb94b4ad320f3c038", "execution_sha256": "36df5f48ec0ac182d7d57c4ea855f980575d06bc154a8baeb94b4ad320f3c038", "code_view": "sources/screenshot.volume/restored.html", "provenance": "sources/screenshot.volume/provenance.json", "source_status": "code", "figure_page": 35, "code_pages": [ 36 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.volume-1.png", "thumbnail": "thumbnails/screenshot.volume-1.jpg", "sha256": "50b9cff88e021288d94230bf5a7486adac144df2e93cd4f20221becf9cd8ccb0", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 27, "operation": "Volume", "code": "go.Volume(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),value=vol.flatten(),\n isomin=.2,isomax=.7,opacity=.1,surface_count=25,colorscale=[[0.,'#3768b0'],[.5,'#e9d1ab'],[1.,'#c3476a']] )" } ], "literal_colormaps": [], "aliases": [ "volume", "新图10", "截图35" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.volume.md", "fidelity_checkpoints": [ { "title": "三维体绘制的完整视觉结构", "preserve": "低透明度多层体表面、连续色阶与深度叠加;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "三维网格上的标量场;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 27, "end_line": 28, "code": "fig=go.Figure(go.Volume(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),value=vol.flatten(),\n isomin=.2,isomax=.7,opacity=.1,surface_count=25,colorscale=[[0.,'#3768b0'],[.5,'#e9d1ab'],[1.,'#c3476a']] ))", "href": "sources/screenshot.volume/restored.html#L27" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.gridded_scatter_3d", "display_name": "三维网格散点场", "tags": [ "三维", "散点", "标量场" ], "purpose": "规则点阵、位置高度与色阶双重编码、色标,用于规则 x/y 网格上的高度 z的展示。", "data_requirements": [ "规则 x/y 网格上的高度 z" ], "composition": "规则点阵、位置高度与色阶双重编码、色标", "visual_features": [ "规则点阵", "位置高度与色阶双重编码", "色标" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 120, "kind": "recipe", "legacy_title": "三维网格散点场", "legacy_ref": "screenshot #11", "source": { "original_code": "sources/screenshot.gridded_scatter_3d/restored.py", "execution_code": "sources/screenshot.gridded_scatter_3d/restored.py", "recipe_section": "sources/screenshot.gridded_scatter_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "f2c1a43aa2e73391c6b04d0395d7821d0fbf928afbf8698ff80e22417e5d3f6e", "code_sha256": "a22e4b55949f703bd7cc7ccdf57427563ab33a8eee5455db18da8807b0f2a566", "execution_sha256": "a22e4b55949f703bd7cc7ccdf57427563ab33a8eee5455db18da8807b0f2a566", "code_view": "sources/screenshot.gridded_scatter_3d/restored.html", "provenance": "sources/screenshot.gridded_scatter_3d/provenance.json", "source_status": "code", "figure_page": 37, "code_pages": [ 38 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.gridded_scatter_3d-1.png", "thumbnail": "thumbnails/screenshot.gridded_scatter_3d-1.jpg", "sha256": "95d341ea17cde532d9164dd70f13b4c29ab10762288b81f9c9e4356f5e3a1b28", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 25, "operation": "Scatter3d", "code": "go.Scatter3d(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),mode='markers',marker=dict(size=4,color=Z.flatten(),colorscale=colorscale_custom,colorbar=dict(title='Color Scale')))" } ], "literal_colormaps": [], "aliases": [ "gridded_scatter_3d", "新图11", "截图37" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.gridded_scatter_3d.md", "fidelity_checkpoints": [ { "title": "三维网格散点场的完整视觉结构", "preserve": "规则点阵、位置高度与色阶双重编码、色标;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "规则 x/y 网格上的高度 z;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 25, "end_line": 25, "code": "fig=go.Figure(go.Scatter3d(x=X.flatten(),y=Y.flatten(),z=Z.flatten(),mode='markers',marker=dict(size=4,color=Z.flatten(),colorscale=colorscale_custom,colorbar=dict(title='Color Scale'))))", "href": "sources/screenshot.gridded_scatter_3d/restored.html#L25" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.contour_lines_3d", "display_name": "三维等高线", "tags": [ "三维", "等高线", "标量场" ], "purpose": "多高度等值曲线、逐层连续颜色与三维轴,用于规则 x/y 网格和连续高度矩阵的展示。", "data_requirements": [ "规则 x/y 网格和连续高度矩阵" ], "composition": "多高度等值曲线、逐层连续颜色与三维轴", "visual_features": [ "多高度等值曲线", "逐层连续颜色与三维轴" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 121, "kind": "recipe", "legacy_title": "三维等高线", "legacy_ref": "screenshot #12", "source": { "original_code": "sources/screenshot.contour_lines_3d/restored.py", "execution_code": "sources/screenshot.contour_lines_3d/restored.py", "recipe_section": "sources/screenshot.contour_lines_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "ecd9c0ad419dcc3cdacadcc92f74da9b8d0aa27f0c37791578bacb8913d19eac", "code_sha256": "c8b14a550080521d543a67515643bded664cd5a4763150eaf99d554b4b83ab4e", "execution_sha256": "c8b14a550080521d543a67515643bded664cd5a4763150eaf99d554b4b83ab4e", "code_view": "sources/screenshot.contour_lines_3d/restored.html", "provenance": "sources/screenshot.contour_lines_3d/provenance.json", "source_status": "code", "figure_page": 39, "code_pages": [ 40, 41 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.contour_lines_3d-1.png", "thumbnail": "thumbnails/screenshot.contour_lines_3d-1.jpg", "sha256": "40b3aff0f30919cd644ddcc792a7396ff66ab50404e558021916b9411c66b25a", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 28, "operation": "contour", "code": "plt.contour(X,Y,Z,levels=levels)" }, { "line": 35, "operation": "Scatter3d", "code": "go.Scatter3d(x=seg[:,0],y=seg[:,1],z=[level]*len(seg),mode='lines',line=dict(color=color,width=8),showlegend=False)" } ], "literal_colormaps": [], "aliases": [ "contour_lines_3d", "新图12", "截图39" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.contour_lines_3d.md", "fidelity_checkpoints": [ { "title": "三维等高线的完整视觉结构", "preserve": "多高度等值曲线、逐层连续颜色与三维轴;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "规则 x/y 网格和连续高度矩阵;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 28, "end_line": 28, "code": "cs=plt.contour(X,Y,Z,levels=levels)", "href": "sources/screenshot.contour_lines_3d/restored.html#L28" }, { "line": 35, "end_line": 35, "code": " fig.add_trace(go.Scatter3d(x=seg[:,0],y=seg[:,1],z=[level]*len(seg),mode='lines',line=dict(color=color,width=8),showlegend=False))", "href": "sources/screenshot.contour_lines_3d/restored.html#L35" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.block_surface_3d", "display_name": "三维方柱曲面", "tags": [ "三维", "柱状", "标量场" ], "purpose": "独立网格方柱、全局高度色阶、十二条白色立方体棱线,用于二维网格及每格非负高度的展示。", "data_requirements": [ "二维网格及每格非负高度;本例高度并非频数" ], "composition": "独立网格方柱、全局高度色阶、十二条白色立方体棱线", "visual_features": [ "独立网格方柱", "全局高度色阶", "十二条白色立方体棱线" ], "adaptation_notes": "代码截图恢复与适配。原标题称三维直方图,但高度来自连续合成曲面;卡片称方柱曲面,真实频数需先分箱计数。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 122, "kind": "recipe", "legacy_title": "三维方柱曲面", "legacy_ref": "screenshot #13", "source": { "original_code": "sources/screenshot.block_surface_3d/restored.py", "execution_code": "sources/screenshot.block_surface_3d/restored.py", "recipe_section": "sources/screenshot.block_surface_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "040b2e58d27d654f7ac1e436336eebd902a2cfec64b0250e97ab284c8bfeb02a", "code_sha256": "a61ab369248f0abf7b09e1f4da5c3cdf2e7a2dc73e2148b85c9fb6bf3eb3b596", "execution_sha256": "a61ab369248f0abf7b09e1f4da5c3cdf2e7a2dc73e2148b85c9fb6bf3eb3b596", "code_view": "sources/screenshot.block_surface_3d/restored.html", "provenance": "sources/screenshot.block_surface_3d/provenance.json", "source_status": "code", "figure_page": 42, "code_pages": [ 43, 44, 45 ] }, "title_mismatch": true, "compatibility_patches": [ "原标题称三维直方图,但高度来自连续合成曲面;卡片称方柱曲面,真实频数需先分箱计数。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.block_surface_3d-1.png", "thumbnail": "thumbnails/screenshot.block_surface_3d-1.jpg", "sha256": "8426acd982815a030a2fe8671049703ad46a806fbdd0f368afa7727ec5f4cd10", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 36, "operation": "Mesh3d", "code": "go.Mesh3d(x=x.flatten(),y=y.flatten(),z=z.flatten(),alphahull=1,flatshading=True,color=color)" }, { "line": 47, "operation": "Scatter3d", "code": "go.Scatter3d(x=edge_x,y=edge_y,z=edge_z,mode='lines',line=dict(color='white',width=3))" } ], "literal_colormaps": [], "aliases": [ "block_surface_3d", "新图13", "截图42" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.block_surface_3d.md", "fidelity_checkpoints": [ { "title": "三维方柱曲面的完整视觉结构", "preserve": "独立网格方柱、全局高度色阶、十二条白色立方体棱线;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "二维网格及每格非负高度;本例高度并非频数;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 36, "end_line": 36, "code": " fig.add_trace(go.Mesh3d(x=x.flatten(),y=y.flatten(),z=z.flatten(),alphahull=1,flatshading=True,color=color))", "href": "sources/screenshot.block_surface_3d/restored.html#L36" }, { "line": 47, "end_line": 47, "code": " fig.add_trace(go.Scatter3d(x=edge_x,y=edge_y,z=edge_z,mode='lines',line=dict(color='white',width=3)))", "href": "sources/screenshot.block_surface_3d/restored.html#L47" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.mesh_surface_3d", "display_name": "三维网格曲面", "tags": [ "三维", "曲面", "标量场" ], "purpose": "连续曲面色阶、白色横纵等值网格、三维坐标,用于规则网格 X、Y、Z的展示。", "data_requirements": [ "规则网格 X、Y、Z" ], "composition": "连续曲面色阶、白色横纵等值网格、三维坐标", "visual_features": [ "连续曲面色阶", "白色横纵等值网格", "三维坐标" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。", "number": 123, "kind": "recipe", "legacy_title": "三维网格曲面", "legacy_ref": "screenshot #14", "source": { "original_code": "sources/screenshot.mesh_surface_3d/restored.py", "execution_code": "sources/screenshot.mesh_surface_3d/restored.py", "recipe_section": "sources/screenshot.mesh_surface_3d/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "0dc05e975966fa351c90be5c48338793eb6a36fe3f45f4ffcef12a25f42dcef7", "code_sha256": "7ae379dde5835c5e88646492c9d2adf8b7bcaf57da7b6fd3c7e75e9b16407eac", "execution_sha256": "7ae379dde5835c5e88646492c9d2adf8b7bcaf57da7b6fd3c7e75e9b16407eac", "code_view": "sources/screenshot.mesh_surface_3d/restored.html", "provenance": "sources/screenshot.mesh_surface_3d/provenance.json", "source_status": "code", "figure_page": 46, "code_pages": [ 47 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "使用Plotly交互显示;预览通过Kaleido导出,画布和边距适配截图检查。3D PDF内部仍含栅格渲染。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.mesh_surface_3d-1.png", "thumbnail": "thumbnails/screenshot.mesh_surface_3d-1.jpg", "sha256": "989482ec7998b6bbc115dda6121f360c217b1ad4f803df5ebd0323743b35e925", "pixels": [ 1500, 1080 ] } ], "code_evidence": [ { "line": 25, "operation": "Surface", "code": "go.Surface(x=X,y=Y,z=Z,colorscale=colorscale_custom,contours={\n 'x':dict(show=True,color='white',width=1,start=x.min(),end=x.max(),size=.1),\n 'y':dict(show=True,color='white',width=1,start=y.min(),end=y.max(),size=.1)})" } ], "literal_colormaps": [], "aliases": [ "mesh_surface_3d", "新图14", "截图46" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.mesh_surface_3d.md", "fidelity_checkpoints": [ { "title": "三维网格曲面的完整视觉结构", "preserve": "连续曲面色阶、白色横纵等值网格、三维坐标;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "规则网格 X、Y、Z;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 25, "end_line": 27, "code": "fig=go.Figure(go.Surface(x=X,y=Y,z=Z,colorscale=colorscale_custom,contours={\n 'x':dict(show=True,color='white',width=1,start=x.min(),end=x.max(),size=.1),\n 'y':dict(show=True,color='white',width=1,start=y.min(),end=y.max(),size=.1)}))", "href": "sources/screenshot.mesh_surface_3d/restored.html#L25" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.depreciation_area", "display_name": "多型号价格堆叠面积", "tags": [ "趋势", "组成", "比较" ], "purpose": "按总量排序、透明面积、白色分界和两列图例,用于Model、Yas、Fiyat ($) 长表的展示。", "data_requirements": [ "Model、Yas、Fiyat ($) 长表;同一年龄覆盖全部型号" ], "composition": "按总量排序、透明面积、白色分界和两列图例", "visual_features": [ "按总量排序", "透明面积", "白色分界和两列图例" ], "adaptation_notes": "代码截图恢复,原数据缺失。原airplane_price_dataset.csv未提供,补充同字段固定种子的合成长表。 年龄排序后再绘制;缺失型号×年龄单元报错而非静默补零。图轴明确是型号均价的累计值,不代表市场总额。", "number": 124, "kind": "recipe", "legacy_title": "多型号价格堆叠面积", "legacy_ref": "screenshot #15", "source": { "original_code": "sources/screenshot.depreciation_area/restored.py", "execution_code": "sources/screenshot.depreciation_area/restored.py", "recipe_section": "sources/screenshot.depreciation_area/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "4f2af909ddd7dcc0be7243c1e25695804bc023217b3477fd2a549e936c80f5ae", "code_sha256": "48aef3f3226ec564c79d4df6967db515b50c839b9015053cc46abbedebdf372b", "execution_sha256": "48aef3f3226ec564c79d4df6967db515b50c839b9015053cc46abbedebdf372b", "code_view": "sources/screenshot.depreciation_area/restored.html", "provenance": "sources/screenshot.depreciation_area/provenance.json", "source_status": "missing_data", "figure_page": 48, "code_pages": [ 49, 50, 51 ] }, "title_mismatch": false, "compatibility_patches": [ "原airplane_price_dataset.csv未提供,补充同字段固定种子的合成长表。", "年龄排序后再绘制;缺失型号×年龄单元报错而非静默补零。图轴明确是型号均价的累计值,不代表市场总额。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.depreciation_area-1.png", "thumbnail": "thumbnails/screenshot.depreciation_area-1.jpg", "sha256": "946251dc59da4e9545d5d1b750613b454106b62013108f834ee3d25eb3dd2296", "pixels": [ 1267, 784 ] } ], "code_evidence": [ { "line": 48, "operation": "fill_between", "code": "ax.fill_between(ages,bottom,bottom+y_values,label=model,color=colors[i],alpha=.6,edgecolor='white',linewidth=1)" } ], "literal_colormaps": [], "aliases": [ "depreciation_area", "新图15", "截图48" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.depreciation_area.md", "fidelity_checkpoints": [ { "title": "多型号价格堆叠面积的完整视觉结构", "preserve": "按总量排序、透明面积、白色分界和两列图例;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "Model、Yas、Fiyat ($) 长表;同一年龄覆盖全部型号;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 48, "end_line": 48, "code": " ax.fill_between(ages,bottom,bottom+y_values,label=model,color=colors[i],alpha=.6,edgecolor='white',linewidth=1)", "href": "sources/screenshot.depreciation_area/restored.html#L48" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.concentric_bars", "display_name": "同心环形柱状图", "tags": [ "排序", "比较", "极坐标" ], "purpose": "同心圆弧、三档颜色、圆弧内数值和径向标签,用于类别及非负数值的展示。", "data_requirements": [ "类别及非负数值;所有环共享角度尺度" ], "composition": "同心圆弧、三档颜色、圆弧内数值和径向标签", "visual_features": [ "同心圆弧", "三档颜色", "圆弧内数值和径向标签" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 125, "kind": "recipe", "legacy_title": "同心环形柱状图", "legacy_ref": "screenshot #16", "source": { "original_code": "sources/screenshot.concentric_bars/restored.py", "execution_code": "sources/screenshot.concentric_bars/restored.py", "recipe_section": "sources/screenshot.concentric_bars/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "d57a09fc467d0d962171ecc97e567a983abba4e0d6601134a854f64db49a37bb", "code_sha256": "b19b375b589743f058665b0c2f5b6ee4ee1de41cd4db5b4e08ccc38f063307e8", "execution_sha256": "b19b375b589743f058665b0c2f5b6ee4ee1de41cd4db5b4e08ccc38f063307e8", "code_view": "sources/screenshot.concentric_bars/restored.html", "provenance": "sources/screenshot.concentric_bars/provenance.json", "source_status": "code", "figure_page": 52, "code_pages": [ 53, 54, 55 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.concentric_bars-1.png", "thumbnail": "thumbnails/screenshot.concentric_bars-1.jpg", "sha256": "aaf15c637d1d986b296afcccbb39025da89a8a66833e486ccd85a9b40cc24a0f", "pixels": [ 1276, 794 ] } ], "code_evidence": [ { "line": 31, "operation": "bar", "code": "ax.bar(x=(theta_start+theta_end)/2,height=ring_width,width=theta_end-theta_start,bottom=inner_radius,color=color)" }, { "line": 32, "operation": "text", "code": "ax.text((theta_start+theta_end)/2,inner_radius+ring_width/2,f'{value}',ha='center',va='center',color='white',fontsize=6,fontweight='bold',rotation=rotation,rotation_mode='anchor')" } ], "literal_colormaps": [], "aliases": [ "concentric_bars", "新图16", "截图52" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.concentric_bars.md", "fidelity_checkpoints": [ { "title": "同心环形柱状图的完整视觉结构", "preserve": "同心圆弧、三档颜色、圆弧内数值和径向标签;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "类别及非负数值;所有环共享角度尺度;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 31, "end_line": 31, "code": " ax.bar(x=(theta_start+theta_end)/2,height=ring_width,width=theta_end-theta_start,bottom=inner_radius,color=color)", "href": "sources/screenshot.concentric_bars/restored.html#L31" }, { "line": 32, "end_line": 32, "code": " ax.text((theta_start+theta_end)/2,inner_radius+ring_width/2,f'{value}',ha='center',va='center',color='white',fontsize=6,fontweight='bold',rotation=rotation,rotation_mode='anchor')", "href": "sources/screenshot.concentric_bars/restored.html#L32" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.rose", "display_name": "南丁格尔玫瑰图", "tags": [ "比较", "极坐标" ], "purpose": "变角宽扇柱、中心留白、白色分隔和标签框,用于正值类别表的展示。", "data_requirements": [ "正值类别表;角宽与半径都编码值,不按面积读比例" ], "composition": "变角宽扇柱、中心留白、白色分隔和标签框", "visual_features": [ "变角宽扇柱", "中心留白", "白色分隔和标签框" ], "adaptation_notes": "代码截图恢复与适配。原百分比公式width/pi*100会合计200%;改为value/sum(values)*100。 设置半径下界0以显示源码bottom=10的中心留白,微调前两个标签位置避免碰撞。", "number": 126, "kind": "recipe", "legacy_title": "南丁格尔玫瑰图", "legacy_ref": "screenshot #17", "source": { "original_code": "sources/screenshot.rose/restored.py", "execution_code": "sources/screenshot.rose/restored.py", "recipe_section": "sources/screenshot.rose/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "159469378b2c4831d99fe27c1190931e215fdaccd347563c83d2264614db6022", "code_sha256": "2eb4b270171e03b7c6e657c6e7be9582db4304e33ad3c78278fd597aeb45f078", "execution_sha256": "2eb4b270171e03b7c6e657c6e7be9582db4304e33ad3c78278fd597aeb45f078", "code_view": "sources/screenshot.rose/restored.html", "provenance": "sources/screenshot.rose/provenance.json", "source_status": "code", "figure_page": 56, "code_pages": [ 57, 58 ] }, "title_mismatch": false, "compatibility_patches": [ "原百分比公式width/pi*100会合计200%;改为value/sum(values)*100。", "设置半径下界0以显示源码bottom=10的中心留白,微调前两个标签位置避免碰撞。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.rose-1.png", "thumbnail": "thumbnails/screenshot.rose-1.jpg", "sha256": "9a9377fdf051e2cee2fc765d5524d45f4667fd5b7c274b5e73fc8dd087f27297", "pixels": [ 1124, 800 ] } ], "code_evidence": [ { "line": 25, "operation": "bar", "code": "ax.bar(start_x,value,width=width[i],bottom=10.,linewidth=2,edgecolor='white',color=colors[i])" }, { "line": 29, "operation": "text", "code": "ax.text(start_x,value*.75+10+offset,label,color='white',fontsize=7,ha='center',va='center',fontweight='bold',\n bbox=dict(facecolor='#75879655',edgecolor='none',boxstyle='round,pad=.5'))" } ], "literal_colormaps": [], "aliases": [ "rose", "新图17", "截图56" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.rose.md", "fidelity_checkpoints": [ { "title": "南丁格尔玫瑰图的完整视觉结构", "preserve": "变角宽扇柱、中心留白、白色分隔和标签框;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "正值类别表;角宽与半径都编码值,不按面积读比例;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 25, "end_line": 25, "code": " ax.bar(start_x,value,width=width[i],bottom=10.,linewidth=2,edgecolor='white',color=colors[i])", "href": "sources/screenshot.rose/restored.html#L25" }, { "line": 29, "end_line": 30, "code": " ax.text(start_x,value*.75+10+offset,label,color='white',fontsize=7,ha='center',va='center',fontweight='bold',\n bbox=dict(facecolor='#75879655',edgecolor='none',boxstyle='round,pad=.5'))", "href": "sources/screenshot.rose/restored.html#L29" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.nested_donut", "display_name": "嵌套环形图", "tags": [ "层级", "组成", "极坐标" ], "purpose": "内外两层圆环、外圈半透明、内外注释框,用于父类别和子类别的非负数值,父值等于子值之和的展示。", "data_requirements": [ "父类别和子类别的非负数值,父值等于子值之和" ], "composition": "内外两层圆环、外圈半透明、内外注释框", "visual_features": [ "内外两层圆环", "外圈半透明", "内外注释框" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 127, "kind": "recipe", "legacy_title": "嵌套环形图", "legacy_ref": "screenshot #18", "source": { "original_code": "sources/screenshot.nested_donut/restored.py", "execution_code": "sources/screenshot.nested_donut/restored.py", "recipe_section": "sources/screenshot.nested_donut/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "883fe4060fde3dc8647c75a8714faa01cd23e9d2dfcdad4251b0e367aee78463", "code_sha256": "48b0995e9de3b6dee491062c09083508d8941fc17fb324c1ec7e4d30782ccb4c", "execution_sha256": "48b0995e9de3b6dee491062c09083508d8941fc17fb324c1ec7e4d30782ccb4c", "code_view": "sources/screenshot.nested_donut/restored.html", "provenance": "sources/screenshot.nested_donut/provenance.json", "source_status": "code", "figure_page": 59, "code_pages": [ 60, 61, 62 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.nested_donut-1.png", "thumbnail": "thumbnails/screenshot.nested_donut-1.jpg", "sha256": "bb1a2bd6ab5aa739e830a1adbce2c878200097f09e7dc78a442b073112550249", "pixels": [ 1166, 816 ] } ], "code_evidence": [ { "line": 28, "operation": "bar", "code": "ax.bar(main_x,width=main_divided,bottom=size,height=size,color=main_colors,edgecolor='white',linewidth=1,align='edge')" }, { "line": 38, "operation": "text", "code": "ax.text(angle,distance,f'{label}\\n{val/sum_vals*100:.1f}% | {val:.0f}',color='white',fontsize=8,ha='center',va='center',fontweight='bold',bbox=dict(facecolor=face,edgecolor='none',boxstyle='round,pad=.5'))" } ], "literal_colormaps": [], "aliases": [ "nested_donut", "新图18", "截图59" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.nested_donut.md", "fidelity_checkpoints": [ { "title": "嵌套环形图的完整视觉结构", "preserve": "内外两层圆环、外圈半透明、内外注释框;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "父类别和子类别的非负数值,父值等于子值之和;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 28, "end_line": 28, "code": "main_bars=ax.bar(main_x,width=main_divided,bottom=size,height=size,color=main_colors,edgecolor='white',linewidth=1,align='edge')", "href": "sources/screenshot.nested_donut/restored.html#L28" }, { "line": 38, "end_line": 38, "code": " ax.text(angle,distance,f'{label}\\n{val/sum_vals*100:.1f}% | {val:.0f}',color='white',fontsize=8,ha='center',va='center',fontweight='bold',bbox=dict(facecolor=face,edgecolor='none',boxstyle='round,pad=.5'))", "href": "sources/screenshot.nested_donut/restored.html#L38" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.ranked_arcs", "display_name": "排名圆弧条形图", "tags": [ "排序", "比较", "极坐标" ], "purpose": "按值排序圆弧、连续色阶、起点名称和端点值,用于类别及可排序的非负百分比的展示。", "data_requirements": [ "类别及可排序的非负百分比" ], "composition": "按值排序圆弧、连续色阶、起点名称和端点值", "visual_features": [ "按值排序圆弧", "连续色阶", "起点名称和端点值" ], "adaptation_notes": "代码截图恢复与适配。保留Faker公司名、共享角度尺度和渐变圆弧;适度扩大画布与文字布局。", "number": 128, "kind": "recipe", "legacy_title": "排名圆弧条形图", "legacy_ref": "screenshot #19", "source": { "original_code": "sources/screenshot.ranked_arcs/restored.py", "execution_code": "sources/screenshot.ranked_arcs/restored.py", "recipe_section": "sources/screenshot.ranked_arcs/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "ef75b7405e4ea84a9c216787da8302d5053ec7b2d53f32959841ee1f72fd5a35", "code_sha256": "f60c03f41d57a9dedd5da85977838a7da357bb922073fed1d6dbf426f300b30e", "execution_sha256": "f60c03f41d57a9dedd5da85977838a7da357bb922073fed1d6dbf426f300b30e", "code_view": "sources/screenshot.ranked_arcs/restored.html", "provenance": "sources/screenshot.ranked_arcs/provenance.json", "source_status": "code", "figure_page": 63, "code_pages": [ 64, 65, 66 ] }, "title_mismatch": false, "compatibility_patches": [ "保留Faker公司名、共享角度尺度和渐变圆弧;适度扩大画布与文字布局。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.ranked_arcs-1.png", "thumbnail": "thumbnails/screenshot.ranked_arcs-1.jpg", "sha256": "2c096166ec10b61e60110f9ef210b50c5f531adb8708692ee0a9b224612e0826", "pixels": [ 1361, 1162 ] } ], "code_evidence": [ { "line": 33, "operation": "bar", "code": "ax.bar((theta_start+theta_end)/2,height=ring_width,width=theta_end-theta_start,bottom=inner_radius,color=colors[i],alpha=.85)" }, { "line": 35, "operation": "text", "code": "ax.text(theta_end,inner_radius+ring_width/2,f' {value:.1f}%',va='center',fontsize=8,fontweight='bold',rotation_mode='anchor',**attr)" } ], "literal_colormaps": [], "aliases": [ "ranked_arcs", "新图19", "截图63" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.ranked_arcs.md", "fidelity_checkpoints": [ { "title": "排名圆弧条形图的完整视觉结构", "preserve": "按值排序圆弧、连续色阶、起点名称和端点值;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "类别及可排序的非负百分比;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 33, "end_line": 33, "code": " ax.bar((theta_start+theta_end)/2,height=ring_width,width=theta_end-theta_start,bottom=inner_radius,color=colors[i],alpha=.85)", "href": "sources/screenshot.ranked_arcs/restored.html#L33" }, { "line": 35, "end_line": 35, "code": " ax.text(theta_end,inner_radius+ring_width/2,f' {value:.1f}%',va='center',fontsize=8,fontweight='bold',rotation_mode='anchor',**attr)", "href": "sources/screenshot.ranked_arcs/restored.html#L35" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.horizon", "display_name": "正负折叠地平线图", "tags": [ "趋势", "多序列", "正负偏差" ], "purpose": "正负色彩、四层透明折叠、白边与多行偏移,用于同一 x 上多条有符号序列,统一折叠层宽的展示。", "data_requirements": [ "同一 x 上多条有符号序列,统一折叠层宽" ], "composition": "正负色彩、四层透明折叠、白边与多行偏移", "visual_features": [ "正负色彩", "四层透明折叠", "白边与多行偏移" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 129, "kind": "recipe", "legacy_title": "正负折叠地平线图", "legacy_ref": "screenshot #20", "source": { "original_code": "sources/screenshot.horizon/restored.py", "execution_code": "sources/screenshot.horizon/restored.py", "recipe_section": "sources/screenshot.horizon/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "d250cb9770793990c2b9b3ce17a3c713c58b51f41ab168c83d6ec4e5654717d2", "code_sha256": "3a6c7a1600e45a0625bc229af277d777ca7cd25ea5a66173f2de600b8dfebef3", "execution_sha256": "3a6c7a1600e45a0625bc229af277d777ca7cd25ea5a66173f2de600b8dfebef3", "code_view": "sources/screenshot.horizon/restored.html", "provenance": "sources/screenshot.horizon/provenance.json", "source_status": "code", "figure_page": 67, "code_pages": [ 68, 69, 70 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.horizon-1.png", "thumbnail": "thumbnails/screenshot.horizon-1.jpg", "sha256": "1c5a1d60c020ebfbe8d5907d289f27d194432af42d0fe9866c468e86e90edd7a", "pixels": [ 1588, 946 ] } ], "code_evidence": [ { "line": 41, "operation": "fill_between", "code": "ax.fill_between(x_smooth,y_bottom,y_top,color=color,alpha=.5)" }, { "line": 42, "operation": "plot", "code": "ax.plot(x_smooth,y_top,color='white',linewidth=.5)" } ], "literal_colormaps": [], "aliases": [ "horizon", "新图20", "截图67" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.horizon.md", "fidelity_checkpoints": [ { "title": "正负折叠地平线图的完整视觉结构", "preserve": "正负色彩、四层透明折叠、白边与多行偏移;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "同一 x 上多条有符号序列,统一折叠层宽;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 41, "end_line": 41, "code": " ax.fill_between(x_smooth,y_bottom,y_top,color=color,alpha=.5)", "href": "sources/screenshot.horizon/restored.html#L41" }, { "line": 42, "end_line": 42, "code": " ax.plot(x_smooth,y_top,color='white',linewidth=.5)", "href": "sources/screenshot.horizon/restored.html#L42" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.radial_bars", "display_name": "极坐标径向柱状图", "tags": [ "比较", "极坐标" ], "purpose": "径向条形、空心基座、三档颜色、旋转数值,用于非负类别值的展示。", "data_requirements": [ "非负类别值;类别角度等分" ], "composition": "径向条形、空心基座、三档颜色、旋转数值", "visual_features": [ "径向条形", "空心基座", "三档颜色", "旋转数值" ], "adaptation_notes": "代码截图恢复与适配。设置半径下界0,保留bottom=10的空心基座。", "number": 130, "kind": "recipe", "legacy_title": "极坐标径向柱状图", "legacy_ref": "screenshot #21", "source": { "original_code": "sources/screenshot.radial_bars/restored.py", "execution_code": "sources/screenshot.radial_bars/restored.py", "recipe_section": "sources/screenshot.radial_bars/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "e9b2d32d06abce5eb034383b47a04eef44c170f81027dddb23fdb4e075c8e1fc", "code_sha256": "cd8e4236444824e70cce770a972611473abd5cf8b3afd3a1169fa76aa6b7fe41", "execution_sha256": "cd8e4236444824e70cce770a972611473abd5cf8b3afd3a1169fa76aa6b7fe41", "code_view": "sources/screenshot.radial_bars/restored.html", "provenance": "sources/screenshot.radial_bars/provenance.json", "source_status": "code", "figure_page": 71, "code_pages": [ 72, 73, 74 ] }, "title_mismatch": false, "compatibility_patches": [ "设置半径下界0,保留bottom=10的空心基座。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.radial_bars-1.png", "thumbnail": "thumbnails/screenshot.radial_bars-1.jpg", "sha256": "a20774a79cd53da108ab4e1a8bfc9a1c27fc79490e22e6721411c8f203115a4e", "pixels": [ 1236, 794 ] } ], "code_evidence": [ { "line": 22, "operation": "bar", "code": "ax.bar(angles,values,width=2*np.pi/count,bottom=10,color=colors,edgecolor='#f1f5f9',linewidth=1,zorder=2)" }, { "line": 25, "operation": "text", "code": "ax.text(angle,value+7,str(value),ha='right' if flip else 'left',va='center',fontsize=8,fontweight='bold',rotation=rotation-180 if flip else rotation,rotation_mode='anchor',color='white',zorder=4)" } ], "literal_colormaps": [], "aliases": [ "radial_bars", "新图21", "截图71" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.radial_bars.md", "fidelity_checkpoints": [ { "title": "极坐标径向柱状图的完整视觉结构", "preserve": "径向条形、空心基座、三档颜色、旋转数值;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "非负类别值;类别角度等分;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 22, "end_line": 22, "code": "bars=ax.bar(angles,values,width=2*np.pi/count,bottom=10,color=colors,edgecolor='#f1f5f9',linewidth=1,zorder=2)", "href": "sources/screenshot.radial_bars/restored.html#L22" }, { "line": 25, "end_line": 25, "code": " ax.text(angle,value+7,str(value),ha='right' if flip else 'left',va='center',fontsize=8,fontweight='bold',rotation=rotation-180 if flip else rotation,rotation_mode='anchor',color='white',zorder=4)", "href": "sources/screenshot.radial_bars/restored.html#L25" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.chord", "display_name": "透明弦图", "tags": [ "网络", "流量", "关系" ], "purpose": "扇区轨道、透明弦带、刻度和白色轨道边界,用于非负方阵,行列类别顺序一致的展示。", "data_requirements": [ "非负方阵,行列类别顺序一致;明确方向语义" ], "composition": "扇区轨道、透明弦带、刻度和白色轨道边界", "visual_features": [ "扇区轨道", "透明弦带", "刻度和白色轨道边界" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 131, "kind": "recipe", "legacy_title": "透明弦图", "legacy_ref": "screenshot #22", "source": { "original_code": "sources/screenshot.chord/restored.py", "execution_code": "sources/screenshot.chord/restored.py", "recipe_section": "sources/screenshot.chord/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "ce184814b73d5675f6f8ebff3cb826931112caab0b089a3e58c28f0ee8f95da8", "code_sha256": "d04455b3cb9188d83f4b3293a5f23438ca6efd78de5e583ac827fe9552c20852", "execution_sha256": "d04455b3cb9188d83f4b3293a5f23438ca6efd78de5e583ac827fe9552c20852", "code_view": "sources/screenshot.chord/restored.html", "provenance": "sources/screenshot.chord/provenance.json", "source_status": "code", "figure_page": 75, "code_pages": [ 76, 77 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.chord-1.png", "thumbnail": "thumbnails/screenshot.chord-1.jpg", "sha256": "60282862d53de1dd5c3a5263336aa1dd4a8bc21cf7157075b38c1ad7a5111fca", "pixels": [ 1127, 916 ] } ], "code_evidence": [ { "line": 30, "operation": "initialize_from_matrix", "code": "Circos.initialize_from_matrix(interaction_df,space=3,r_lim=(63,70),cmap=cmap,ticks_interval=500,\n label_kws=dict(r=64,size=6,color='white',fontweight='bold'),\n ticks_kws=dict(line_kws=dict(ec='#597cab'),text_kws=dict(weight='bold'),label_size=6),link_kws=dict(alpha=.4))" }, { "line": 36, "operation": "text", "code": "fig.text(.04,.57,'基因关联弦图',fontsize=21,fontweight='bold',color='#515a85')" } ], "literal_colormaps": [], "aliases": [ "chord", "新图22", "截图75" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.chord.md", "fidelity_checkpoints": [ { "title": "透明弦图的完整视觉结构", "preserve": "扇区轨道、透明弦带、刻度和白色轨道边界;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "非负方阵,行列类别顺序一致;明确方向语义;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 30, "end_line": 32, "code": "circos=Circos.initialize_from_matrix(interaction_df,space=3,r_lim=(63,70),cmap=cmap,ticks_interval=500,\n label_kws=dict(r=64,size=6,color='white',fontweight='bold'),\n ticks_kws=dict(line_kws=dict(ec='#597cab'),text_kws=dict(weight='bold'),label_size=6),link_kws=dict(alpha=.4))", "href": "sources/screenshot.chord/restored.html#L30" }, { "line": 36, "end_line": 36, "code": "fig.text(.04,.57,'基因关联弦图',fontsize=21,fontweight='bold',color='#515a85')", "href": "sources/screenshot.chord/restored.html#L36" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.marginal_heatmap", "display_name": "带边际柱形的表格热图", "tags": [ "矩阵", "汇总", "组合" ], "purpose": "热图文本、白格线、上方列和、右方行和及数值,用于有行列标签的数值矩阵,边际求和有意义的展示。", "data_requirements": [ "有行列标签的数值矩阵,边际求和有意义" ], "composition": "热图文本、白格线、上方列和、右方行和及数值", "visual_features": [ "热图文本", "白格线", "上方列和", "右方行和及数值" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 132, "kind": "recipe", "legacy_title": "带边际柱形的表格热图", "legacy_ref": "screenshot #23", "source": { "original_code": "sources/screenshot.marginal_heatmap/restored.py", "execution_code": "sources/screenshot.marginal_heatmap/restored.py", "recipe_section": "sources/screenshot.marginal_heatmap/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "60f11917637539e807c49daced9b42d0fa4ae751424d0041cb884829d53dda14", "code_sha256": "c5ec4a3d67e02f5730c09f01894b6af5cca4bd9f45c539d91e09ae4e681a0abf", "execution_sha256": "c5ec4a3d67e02f5730c09f01894b6af5cca4bd9f45c539d91e09ae4e681a0abf", "code_view": "sources/screenshot.marginal_heatmap/restored.html", "provenance": "sources/screenshot.marginal_heatmap/provenance.json", "source_status": "code", "figure_page": 78, "code_pages": [ 79, 80, 81, 82, 83 ], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.marginal_heatmap-1.png", "thumbnail": "thumbnails/screenshot.marginal_heatmap-1.jpg", "sha256": "d20d0bec5135bbec65356e910e7a02c9f4b56dca0d3945268f36b29d54ee2f91", "pixels": [ 2512, 1225 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 30, "operation": "imshow", "code": "ax_heatmap.imshow(data,cmap=cmap,aspect='auto',vmin=-np.max(np.abs(data)),vmax=np.max(np.abs(data)))" }, { "line": 34, "operation": "text", "code": "ax_heatmap.text(j,i,f'{v:.1f}',ha='center',va='center',fontsize=6,color=color,fontweight='bold')" }, { "line": 35, "operation": "plot", "code": "for i in range(data.shape[0]+1):ax_heatmap.plot([-.5,data.shape[1]-.5],[i-.5]*2,color='white',linewidth=1)" }, { "line": 40, "operation": "bar", "code": "ax_top.bar(np.arange(len(years)),bar_data_year,color=[palette_stops('diverging')[0] if v<0 else palette_stops('diverging')[-1] for v in bar_data_year])" }, { "line": 44, "operation": "barh", "code": "ax_right.barh(np.arange(len(months)),bar_data_month,color=[palette_stops('diverging')[0] if v<0 else palette_stops('diverging')[-1] for v in bar_data_month])" } ], "literal_colormaps": [], "aliases": [ "marginal_heatmap", "新图23", "截图78" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.marginal_heatmap.md", "fidelity_checkpoints": [ { "title": "带边际柱形的表格热图的完整视觉结构", "preserve": "热图文本、白格线、上方列和、右方行和及数值;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "有行列标签的数值矩阵,边际求和有意义;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 30, "end_line": 30, "code": "ax_heatmap.imshow(data,cmap=cmap,aspect='auto',vmin=-np.max(np.abs(data)),vmax=np.max(np.abs(data)))", "href": "sources/screenshot.marginal_heatmap/restored.html#L30" }, { "line": 34, "end_line": 34, "code": " ax_heatmap.text(j,i,f'{v:.1f}',ha='center',va='center',fontsize=6,color=color,fontweight='bold')", "href": "sources/screenshot.marginal_heatmap/restored.html#L34" }, { "line": 35, "end_line": 35, "code": "for i in range(data.shape[0]+1):ax_heatmap.plot([-.5,data.shape[1]-.5],[i-.5]*2,color='white',linewidth=1)", "href": "sources/screenshot.marginal_heatmap/restored.html#L35" }, { "line": 40, "end_line": 40, "code": "ax_top.bar(np.arange(len(years)),bar_data_year,color=[palette_stops('diverging')[0] if v<0 else palette_stops('diverging')[-1] for v in bar_data_year])", "href": "sources/screenshot.marginal_heatmap/restored.html#L40" }, { "line": 44, "end_line": 44, "code": "ax_right.barh(np.arange(len(months)),bar_data_month,color=[palette_stops('diverging')[0] if v<0 else palette_stops('diverging')[-1] for v in bar_data_month])", "href": "sources/screenshot.marginal_heatmap/restored.html#L44" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.interval_steps", "display_name": "阶梯折线与区间带", "tags": [ "趋势", "误差", "多序列" ], "purpose": "阶梯曲线、阶梯透明区间、双色层次和注释,用于x、各组估计值及上下界的展示。", "data_requirements": [ "x、各组估计值及上下界;真实区间必须来自计算" ], "composition": "阶梯曲线、阶梯透明区间、双色层次和注释", "visual_features": [ "阶梯曲线", "阶梯透明区间", "双色层次和注释" ], "adaptation_notes": "代码截图恢复与适配。原区间宽度随机生成,卡片与示例明确标为示意区间;真实置信区间必须由真实统计估计替换。", "number": 133, "kind": "recipe", "legacy_title": "阶梯折线与区间带", "legacy_ref": "screenshot #24", "source": { "original_code": "sources/screenshot.interval_steps/restored.py", "execution_code": "sources/screenshot.interval_steps/restored.py", "recipe_section": "sources/screenshot.interval_steps/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "e3846a021f9f6594f7488e26fc94ec8e05fb0df54fff6ac944347c0758b15a82", "code_sha256": "63139bd8b8a4bcfcf24488181407a455690350b1d24da9d75c4880fb8b6e598d", "execution_sha256": "63139bd8b8a4bcfcf24488181407a455690350b1d24da9d75c4880fb8b6e598d", "code_view": "sources/screenshot.interval_steps/restored.html", "provenance": "sources/screenshot.interval_steps/provenance.json", "source_status": "code", "figure_page": 84, "code_pages": [ 85, 86 ] }, "title_mismatch": false, "compatibility_patches": [ "原区间宽度随机生成,卡片与示例明确标为示意区间;真实置信区间必须由真实统计估计替换。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.interval_steps-1.png", "thumbnail": "thumbnails/screenshot.interval_steps-1.jpg", "sha256": "2ae5c5a5eed7d89fcbdbf37c027cf771613fcf4f93751c1c4e9a4e2e1c2ca7fc", "pixels": [ 1588, 786 ] } ], "code_evidence": [ { "line": 27, "operation": "set_facecolor", "code": "ax.set_facecolor('#f4f6f8')" }, { "line": 29, "operation": "step", "code": "ax.step(x,y,label=f'类别{chr(65+i)}',linewidth=1,where='mid',color=line_color,zorder=3)" }, { "line": 30, "operation": "fill_between", "code": "ax.fill_between(x,y-ci,y+ci,label=f'示意区间{chr(65+i)}',alpha=.4,step='mid',color=fill_color,zorder=3 if i<2 else 2)" }, { "line": 31, "operation": "text", "code": "ax.text(1940,5,'低值期',ha='center',color='#3f51af',fontweight='bold')" } ], "literal_colormaps": [], "aliases": [ "interval_steps", "新图24", "截图84" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.interval_steps.md", "fidelity_checkpoints": [ { "title": "阶梯折线与区间带的完整视觉结构", "preserve": "阶梯曲线、阶梯透明区间、双色层次和注释;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "x、各组估计值及上下界;真实区间必须来自计算;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 27, "end_line": 27, "code": "ax.set_facecolor('#f4f6f8')", "href": "sources/screenshot.interval_steps/restored.html#L27" }, { "line": 29, "end_line": 29, "code": " ax.step(x,y,label=f'类别{chr(65+i)}',linewidth=1,where='mid',color=line_color,zorder=3)", "href": "sources/screenshot.interval_steps/restored.html#L29" }, { "line": 30, "end_line": 30, "code": " ax.fill_between(x,y-ci,y+ci,label=f'示意区间{chr(65+i)}',alpha=.4,step='mid',color=fill_color,zorder=3 if i<2 else 2)", "href": "sources/screenshot.interval_steps/restored.html#L30" }, { "line": 31, "end_line": 31, "code": "ax.text(1940,5,'低值期',ha='center',color='#3f51af',fontweight='bold')", "href": "sources/screenshot.interval_steps/restored.html#L31" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.streamgraph", "display_name": "双向峰形河流图", "tags": [ "趋势", "流量", "多序列" ], "purpose": "wiggle 基线、144条峰形带、白色边界和分档颜色,用于同一 x 上的非负序列的展示。", "data_requirements": [ "同一 x 上的非负序列" ], "composition": "wiggle 基线、144条峰形带、白色边界和分档颜色", "visual_features": [ "wiggle 基线", "144条峰形带", "白色边界和分档颜色" ], "adaptation_notes": "代码截图恢复与适配。合并008(第一代码页)与088–090,恢复144条双向峰形和wiggle基线。 原颜色按峰值分档但色条为连续映射;色条改为同一组阈值和颜色,使图例与实际颜色一致。", "number": 134, "kind": "recipe", "legacy_title": "双向峰形河流图", "legacy_ref": "screenshot #25", "source": { "original_code": "sources/screenshot.streamgraph/restored.py", "execution_code": "sources/screenshot.streamgraph/restored.py", "recipe_section": "sources/screenshot.streamgraph/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "584a72af0f17e32d348061a0a1b4969ce6e182e7944786fab568e438813074c1", "code_sha256": "accd40013fa37c8e2dd095bbdff9c3ac0bca26a023fef5b9f76b9bf145cf7c5d", "execution_sha256": "accd40013fa37c8e2dd095bbdff9c3ac0bca26a023fef5b9f76b9bf145cf7c5d", "code_view": "sources/screenshot.streamgraph/restored.html", "provenance": "sources/screenshot.streamgraph/provenance.json", "source_status": "code", "figure_page": 87, "code_pages": [ 8, 88, 89, 90 ] }, "title_mismatch": false, "compatibility_patches": [ "合并008(第一代码页)与088–090,恢复144条双向峰形和wiggle基线。", "原颜色按峰值分档但色条为连续映射;色条改为同一组阈值和颜色,使图例与实际颜色一致。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.streamgraph-1.png", "thumbnail": "thumbnails/screenshot.streamgraph-1.jpg", "sha256": "6699ddf327a059812d3c20c7a684661080bb18e372f4a25881d1af7b23208cc7", "pixels": [ 1577, 786 ] } ], "code_evidence": [ { "line": 43, "operation": "stackplot", "code": "ax.stackplot(x,y_list,colors=color_list,labels=categories,zorder=10,alpha=1,baseline='wiggle')" }, { "line": 46, "operation": "plot", "code": "ax.plot(verts[:,0],verts[:,1],color='white',zorder=20,linewidth=.5)" }, { "line": 49, "operation": "colorbar", "code": "fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,orientation='vertical',pad=.01,fraction=.05,extend='max')" } ], "literal_colormaps": [], "aliases": [ "streamgraph", "新图25", "截图87" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.streamgraph.md", "fidelity_checkpoints": [ { "title": "双向峰形河流图的完整视觉结构", "preserve": "wiggle 基线、144条峰形带、白色边界和分档颜色;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "同一 x 上的非负序列;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 43, "end_line": 43, "code": "polys=ax.stackplot(x,y_list,colors=color_list,labels=categories,zorder=10,alpha=1,baseline='wiggle')", "href": "sources/screenshot.streamgraph/restored.html#L43" }, { "line": 46, "end_line": 46, "code": " ax.plot(verts[:,0],verts[:,1],color='white',zorder=20,linewidth=.5)", "href": "sources/screenshot.streamgraph/restored.html#L46" }, { "line": 49, "end_line": 49, "code": "cb=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),ax=ax,orientation='vertical',pad=.01,fraction=.05,extend='max')", "href": "sources/screenshot.streamgraph/restored.html#L49" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.correlation_network", "display_name": "相关矩阵与连线网络", "tags": [ "相关", "矩阵", "网络", "组合" ], "purpose": "三角矩阵、方块大小及发散色、连线宽度颜色、三种图例,用于相关矩阵及每个网络节点到特征的 r/p 表的展示。", "data_requirements": [ "相关矩阵及每个网络节点到特征的 r/p 表" ], "composition": "三角矩阵、方块大小及发散色、连线宽度颜色、三种图例", "visual_features": [ "三角矩阵", "方块大小及发散色", "连线宽度颜色", "三种图例" ], "adaptation_notes": "代码截图恢复与适配。原示例随机方阵并非有效相关矩阵;演示改由合成样本计算对称Pearson矩阵。 原方块宽高直接使用带符号r;改为abs(r),颜色保留符号。线宽按abs(r)分档。 修正连续颜色插值和标签与矩阵坐标的对应。网络r/p仍为演示输入,不声称做了Mantel检验;真实任务需提供实际检验结果。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 135, "kind": "recipe", "legacy_title": "相关矩阵与连线网络", "legacy_ref": "screenshot #26", "source": { "original_code": "sources/screenshot.correlation_network/restored.py", "execution_code": "sources/screenshot.correlation_network/restored.py", "recipe_section": "sources/screenshot.correlation_network/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "18d80ecd9f222eb2690b6122e2799a3ad318b94b93776b3a9433ee796636a2df", "code_sha256": "e4b4155bbdf84bdeae097bce9f930270061ab55bc04526c08ca3e8f5ddeb57c9", "execution_sha256": "e4b4155bbdf84bdeae097bce9f930270061ab55bc04526c08ca3e8f5ddeb57c9", "code_view": "sources/screenshot.correlation_network/restored.html", "provenance": "sources/screenshot.correlation_network/provenance.json", "source_status": "code", "figure_page": 91, "code_pages": [ 92, 93, 94, 95, 96, 97 ], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "原示例随机方阵并非有效相关矩阵;演示改由合成样本计算对称Pearson矩阵。", "原方块宽高直接使用带符号r;改为abs(r),颜色保留符号。线宽按abs(r)分档。", "修正连续颜色插值和标签与矩阵坐标的对应。网络r/p仍为演示输入,不声称做了Mantel检验;真实任务需提供实际检验结果。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.correlation_network-1.png", "thumbnail": "thumbnails/screenshot.correlation_network-1.jpg", "sha256": "1e59aeaa59b7dadfa62d7a93c67e765e0f25459be706316aea0a479a70ffcab4", "pixels": [ 2076, 1433 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 38, "operation": "text", "code": "ax.text(spec_pos_y[i+1]-4.5,spec_pos_y[-2-i]-3.5,spec,ha='center',va='center')" }, { "line": 40, "operation": "plot", "code": "ax.plot([spec_pos_y[i+1]-4,-.5+j],[spec_pos_y[-2-i]-3,feature_count-j-.5],linestyle='-',linewidth=calc_r_width(r_data[i,j]),color=calc_p_color(p_data[i,j]),zorder=1-p_data[i,j],marker='o',markersize=4)" }, { "line": 46, "operation": "Rectangle", "code": "ax.add_patch(patches.Rectangle((feature_count-i-1,j),1,1,linewidth=.25,edgecolor='#999999',facecolor='white'))" }, { "line": 57, "operation": "colorbar", "code": "cb=fig.colorbar(ScalarMappable(norm=Normalize(-1,1),cmap=cmap),cax=fig.add_axes([.81,.13,.025,.19]))" } ], "literal_colormaps": [], "aliases": [ "correlation_network", "新图26", "截图91" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.correlation_network.md", "fidelity_checkpoints": [ { "title": "相关矩阵与连线网络的完整视觉结构", "preserve": "三角矩阵、方块大小及发散色、连线宽度颜色、三种图例;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "相关矩阵及每个网络节点到特征的 r/p 表;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 38, "end_line": 38, "code": " ax.text(spec_pos_y[i+1]-4.5,spec_pos_y[-2-i]-3.5,spec,ha='center',va='center')", "href": "sources/screenshot.correlation_network/restored.html#L38" }, { "line": 40, "end_line": 40, "code": " ax.plot([spec_pos_y[i+1]-4,-.5+j],[spec_pos_y[-2-i]-3,feature_count-j-.5],linestyle='-',linewidth=calc_r_width(r_data[i,j]),color=calc_p_color(p_data[i,j]),zorder=1-p_data[i,j],marker='o',markersize=4)", "href": "sources/screenshot.correlation_network/restored.html#L40" }, { "line": 46, "end_line": 46, "code": " ax.add_patch(patches.Rectangle((feature_count-i-1,j),1,1,linewidth=.25,edgecolor='#999999',facecolor='white'))", "href": "sources/screenshot.correlation_network/restored.html#L46" }, { "line": 57, "end_line": 57, "code": "cb=fig.colorbar(ScalarMappable(norm=Normalize(-1,1),cmap=cmap),cax=fig.add_axes([.81,.13,.025,.19]))", "href": "sources/screenshot.correlation_network/restored.html#L57" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.radial_heatmap", "display_name": "径向环形热图", "tags": [ "矩阵", "极坐标" ], "purpose": "分层环形单元、白边、缺口行标签、外圈列标签与色标,用于有行列标签的二维数值矩阵的展示。", "data_requirements": [ "有行列标签的二维数值矩阵" ], "composition": "分层环形单元、白边、缺口行标签、外圈列标签与色标", "visual_features": [ "分层环形单元", "白边", "缺口行标签", "外圈列标签与色标" ], "adaptation_notes": "代码截图恢复与适配。显式align=edge统一环形单元角度边界与缺口;设置半径下界0保留中心空白。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 136, "kind": "recipe", "legacy_title": "径向环形热图", "legacy_ref": "screenshot #27", "source": { "original_code": "sources/screenshot.radial_heatmap/restored.py", "execution_code": "sources/screenshot.radial_heatmap/restored.py", "recipe_section": "sources/screenshot.radial_heatmap/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "95148e7d0f5941fcebe8a678c6bcd71d7cf175bfa5c26bd6f707c5fa9bcd4018", "code_sha256": "1fe8731392ef98319047709be75ad88d4ed8e7acf65119350e733211da61c114", "execution_sha256": "1fe8731392ef98319047709be75ad88d4ed8e7acf65119350e733211da61c114", "code_view": "sources/screenshot.radial_heatmap/restored.html", "provenance": "sources/screenshot.radial_heatmap/provenance.json", "source_status": "code", "figure_page": 98, "code_pages": [ 99, 100, 101, 102 ], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "显式align=edge统一环形单元角度边界与缺口;设置半径下界0保留中心空白。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.radial_heatmap-1.png", "thumbnail": "thumbnails/screenshot.radial_heatmap-1.jpg", "sha256": "7162798f9858dfa8b3519e9953604945f85061da9718c95990caac6c8421e1ee", "pixels": [ 1683, 1310 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 30, "operation": "bar", "code": "ax.bar(theta[j],height,bottom=radius,width=width,color=cmap((value-vmin)/(vmax-vmin)),edgecolor='white',linewidth=.5,align='edge')" }, { "line": 31, "operation": "text", "code": "ax.text(theta[-1]+width+np.radians(gap_angle/2),radius+height/2,str(i+1),ha='center',va='center',fontsize=6,rotation=-10)" }, { "line": 36, "operation": "colorbar", "code": "cb=fig.colorbar(ScalarMappable(norm=Normalize(vmin,vmax),cmap=cmap),ax=ax,orientation='vertical',pad=.15,fraction=.05)" } ], "literal_colormaps": [], "aliases": [ "radial_heatmap", "新图27", "截图98" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.radial_heatmap.md", "fidelity_checkpoints": [ { "title": "径向环形热图的完整视觉结构", "preserve": "分层环形单元、白边、缺口行标签、外圈列标签与色标;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "有行列标签的二维数值矩阵;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 30, "end_line": 30, "code": " ax.bar(theta[j],height,bottom=radius,width=width,color=cmap((value-vmin)/(vmax-vmin)),edgecolor='white',linewidth=.5,align='edge')", "href": "sources/screenshot.radial_heatmap/restored.html#L30" }, { "line": 31, "end_line": 31, "code": " ax.text(theta[-1]+width+np.radians(gap_angle/2),radius+height/2,str(i+1),ha='center',va='center',fontsize=6,rotation=-10)", "href": "sources/screenshot.radial_heatmap/restored.html#L31" }, { "line": 36, "end_line": 36, "code": "cb=fig.colorbar(ScalarMappable(norm=Normalize(vmin,vmax),cmap=cmap),ax=ax,orientation='vertical',pad=.15,fraction=.05)", "href": "sources/screenshot.radial_heatmap/restored.html#L36" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.hexbin", "display_name": "六边形空间热图", "tags": [ "空间", "密度", "聚合" ], "purpose": "六边形网格、白色细边、发散色阶和共享色标,用于x、y 和测量值 z的展示。", "data_requirements": [ "x、y 和测量值 z;按六边形内均值聚合" ], "composition": "六边形网格、白色细边、发散色阶和共享色标", "visual_features": [ "六边形网格", "白色细边", "发散色阶和共享色标" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。 热图默认读取项目配色;连续插值、中性色、透明度及数据归一化保留,数值文字按实际底色选择对比色。", "number": 137, "kind": "recipe", "legacy_title": "六边形空间热图", "legacy_ref": "screenshot #28", "source": { "original_code": "sources/screenshot.hexbin/restored.py", "execution_code": "sources/screenshot.hexbin/restored.py", "recipe_section": "sources/screenshot.hexbin/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "9f489f2a69f5adbd629daea0d9c52b2e8a2a2f6a01b286520b263dd6f5cfe96a", "code_sha256": "12278777792cf48af53f3d47ae68b37c2a2fde6c1b73297b2ee80b93b8e29ac2", "execution_sha256": "12278777792cf48af53f3d47ae68b37c2a2fde6c1b73297b2ee80b93b8e29ac2", "code_view": "sources/screenshot.hexbin/restored.html", "provenance": "sources/screenshot.hexbin/provenance.json", "source_status": "code", "figure_page": 103, "code_pages": [ 104, 105 ], "palette_binding": "project" }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.hexbin-1.png", "thumbnail": "thumbnails/screenshot.hexbin-1.jpg", "sha256": "04ec2c6b2daa1274f8fb1dfee9da8e2b705d6f0bcce09d5321325f17e3bbf66c", "pixels": [ 2187, 1313 ], "palette": [ "#9693B6", "#A49FBE", "#A5A1B2", "#AAA0A0", "#C6A497", "#DE9888", "#F1837A", "#E9687A" ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 29, "operation": "hexbin", "code": "hb=ax.hexbin(x,y,C=z,gridsize=50,cmap=cmap,reduce_C_function=np.mean,edgecolors='white',linewidths=.5)" }, { "line": 30, "operation": "colorbar", "code": "cb=fig.colorbar(hb,ax=ax,orientation='vertical',pad=.01,fraction=.05)" } ], "literal_colormaps": [], "aliases": [ "hexbin", "新图28", "截图103" ], "related_ids": [], "review": { "visual": "palette_switch_verified_pastel_girl_and_blue_sky", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.hexbin.md", "fidelity_checkpoints": [ { "title": "六边形空间热图的完整视觉结构", "preserve": "六边形网格、白色细边、发散色阶和共享色标;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "x、y 和测量值 z;按六边形内均值聚合;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 29, "end_line": 29, "code": "hb=ax.hexbin(x,y,C=z,gridsize=50,cmap=cmap,reduce_C_function=np.mean,edgecolors='white',linewidths=.5)", "href": "sources/screenshot.hexbin/restored.html#L29" }, { "line": 30, "end_line": 30, "code": "cb=fig.colorbar(hb,ax=ax,orientation='vertical',pad=.01,fraction=.05)", "href": "sources/screenshot.hexbin/restored.html#L30" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.classified_scatter", "display_name": "分类散点与决策区域", "tags": [ "分类", "散点", "机器学习" ], "purpose": "半透明散点、淡色决策背景、横纵 rug 边际标记,用于两个数值特征和类别标签的展示。", "data_requirements": [ "两个数值特征和类别标签;背景为拟合模型预测" ], "composition": "半透明散点、淡色决策背景、横纵 rug 边际标记", "visual_features": [ "半透明散点", "淡色决策背景", "横纵 rug 边际标记" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 138, "kind": "recipe", "legacy_title": "分类散点与决策区域", "legacy_ref": "screenshot #29", "source": { "original_code": "sources/screenshot.classified_scatter/restored.py", "execution_code": "sources/screenshot.classified_scatter/restored.py", "recipe_section": "sources/screenshot.classified_scatter/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "0a68741106572943ec3979e57cb200b2f95842fc7824a4336db9ecdf5a65146d", "code_sha256": "b2c0c60d9aac1521234095acf757ea6969ac755ae9b6dd1f82d196a719370ad6", "execution_sha256": "b2c0c60d9aac1521234095acf757ea6969ac755ae9b6dd1f82d196a719370ad6", "code_view": "sources/screenshot.classified_scatter/restored.html", "provenance": "sources/screenshot.classified_scatter/provenance.json", "source_status": "code", "figure_page": 106, "code_pages": [ 107, 108, 109 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.classified_scatter-1.png", "thumbnail": "thumbnails/screenshot.classified_scatter-1.jpg", "sha256": "7ba5c986610318a652560fb55329a17cf9c18e2147300ead47cdebfddbfa9489", "pixels": [ 1425, 864 ] } ], "code_evidence": [ { "line": 32, "operation": "contourf", "code": "ax.contourf(xx,yy,Z,levels=[-.5,.5,1.5,2.5],alpha=.2,cmap=ListedColormap(colors))" }, { "line": 34, "operation": "scatter", "code": "ax.scatter(a,b,s=100,c=c,alpha=.5,label=f'类别{i+1}')" } ], "literal_colormaps": [], "aliases": [ "classified_scatter", "新图29", "截图106" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.classified_scatter.md", "fidelity_checkpoints": [ { "title": "分类散点与决策区域的完整视觉结构", "preserve": "半透明散点、淡色决策背景、横纵 rug 边际标记;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "两个数值特征和类别标签;背景为拟合模型预测;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 32, "end_line": 32, "code": "ax.contourf(xx,yy,Z,levels=[-.5,.5,1.5,2.5],alpha=.2,cmap=ListedColormap(colors))", "href": "sources/screenshot.classified_scatter/restored.html#L32" }, { "line": 34, "end_line": 34, "code": " ax.scatter(a,b,s=100,c=c,alpha=.5,label=f'类别{i+1}')", "href": "sources/screenshot.classified_scatter/restored.html#L34" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.polar_scatter", "display_name": "带背景圆环的极坐标散点", "tags": [ "极坐标", "散点", "比较" ], "purpose": "三组透明散点、交替浅色背景圆环、角度轴和图例,用于角度(弧度)和非负半径,以及分组的展示。", "data_requirements": [ "角度(弧度)和非负半径,以及分组" ], "composition": "三组透明散点、交替浅色背景圆环、角度轴和图例", "visual_features": [ "三组透明散点", "交替浅色背景圆环", "角度轴和图例" ], "adaptation_notes": "代码截图恢复与适配。恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。", "number": 139, "kind": "recipe", "legacy_title": "带背景圆环的极坐标散点", "legacy_ref": "screenshot #30", "source": { "original_code": "sources/screenshot.polar_scatter/restored.py", "execution_code": "sources/screenshot.polar_scatter/restored.py", "recipe_section": "sources/screenshot.polar_scatter/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "73314a218fe553d9bdd574a787872b8a07fc9b72518156d9a694077768ccd935", "code_sha256": "d776a32b129252191b8e4241f7a5f4ef499d638d713b6281f0d02094d53d1366", "execution_sha256": "d776a32b129252191b8e4241f7a5f4ef499d638d713b6281f0d02094d53d1366", "code_view": "sources/screenshot.polar_scatter/restored.html", "provenance": "sources/screenshot.polar_scatter/provenance.json", "source_status": "code", "figure_page": 110, "code_pages": [ 111, 112 ] }, "title_mismatch": false, "compatibility_patches": [ "恢复全部可见绘图层与示例数据;调整导入、缩进、标签或输出边距以兼容当前运行环境。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.polar_scatter-1.png", "thumbnail": "thumbnails/screenshot.polar_scatter-1.jpg", "sha256": "bd358199d56e5192871b228395793864281e6fe1abcf16deef3d103ffc4d0067", "pixels": [ 968, 786 ] } ], "code_evidence": [ { "line": 24, "operation": "scatter", "code": "ax.scatter(theta,r,s=100,c=color,alpha=.5,label=f'类别{i+1}',zorder=10)" }, { "line": 27, "operation": "fill_between", "code": "ax.fill_between(theta,20*i+10,20*i+20,color=colors[0],alpha=.15,zorder=1)" } ], "literal_colormaps": [], "aliases": [ "polar_scatter", "新图30", "截图110" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.polar_scatter.md", "fidelity_checkpoints": [ { "title": "带背景圆环的极坐标散点的完整视觉结构", "preserve": "三组透明散点、交替浅色背景圆环、角度轴和图例;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "角度(弧度)和非负半径,以及分组;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 24, "end_line": 24, "code": " ax.scatter(theta,r,s=100,c=color,alpha=.5,label=f'类别{i+1}',zorder=10)", "href": "sources/screenshot.polar_scatter/restored.html#L24" }, { "line": 27, "end_line": 27, "code": " ax.fill_between(theta,20*i+10,20*i+20,color=colors[0],alpha=.15,zorder=1)", "href": "sources/screenshot.polar_scatter/restored.html#L27" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.polar_step_area", "display_name": "环形刻度阶梯面积图", "tags": [ "极坐标", "趋势", "阶梯" ], "purpose": "交替背景环、角度射线、描边径向刻度、阶梯填充与轮廓,用于按角度有序的非负半径的展示。", "data_requirements": [ "按角度有序的非负半径;源码为随机阶梯面积,不是真正频数直方图" ], "composition": "交替背景环、角度射线、描边径向刻度、阶梯填充与轮廓", "visual_features": [ "交替背景环", "角度射线", "描边径向刻度", "阶梯填充与轮廓" ], "adaptation_notes": "代码截图恢复与适配。原标题称直方图,但代码绘制随机半径阶梯面积;按真实编码命名,不当作频数图。", "number": 140, "kind": "recipe", "legacy_title": "环形刻度阶梯面积图", "legacy_ref": "screenshot #31", "source": { "original_code": "sources/screenshot.polar_step_area/restored.py", "execution_code": "sources/screenshot.polar_step_area/restored.py", "recipe_section": "sources/screenshot.polar_step_area/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "ea5a376b91104d57a043d2f0f930bcdad747933e68213cedf0da662ec87bf8fd", "code_sha256": "77e0e6de5316e51e4e11243c10806f9efce69e54c487eef080a190818f5ba861", "execution_sha256": "77e0e6de5316e51e4e11243c10806f9efce69e54c487eef080a190818f5ba861", "code_view": "sources/screenshot.polar_step_area/restored.html", "provenance": "sources/screenshot.polar_step_area/provenance.json", "source_status": "code", "figure_page": 113, "code_pages": [ 113, 114, 115 ] }, "title_mismatch": true, "compatibility_patches": [ "原标题称直方图,但代码绘制随机半径阶梯面积;按真实编码命名,不当作频数图。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.polar_step_area-1.png", "thumbnail": "thumbnails/screenshot.polar_step_area-1.jpg", "sha256": "03968a92c286c61c06ca34e703e6b9ed39c8f0365cd419f888cc5b92852e71ae", "pixels": [ 958, 958 ] } ], "code_evidence": [ { "line": 25, "operation": "plot", "code": "ax.plot([angle,angle],[radius,100],linewidth=.5,color='white')" }, { "line": 26, "operation": "text", "code": "ax.text(angle,radius+4*length,str(i),rotation=i-90,rotation_mode='anchor',va='top',ha='center')" }, { "line": 37, "operation": "fill_between", "code": "ax.fill_between(T,i,i+100,color='#597cab33',zorder=-50)" }, { "line": 38, "operation": "scatter", "code": "ax.scatter([0],[0],20,facecolor=bgcolor,edgecolor='#597cab',zorder=1000)" }, { "line": 44, "operation": "fill", "code": "ax.fill(T,R,color='#e6a6a5',zorder=150,alpha=.3)" } ], "literal_colormaps": [], "aliases": [ "polar_step_area", "新图31", "截图113" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.polar_step_area.md", "fidelity_checkpoints": [ { "title": "环形刻度阶梯面积图的完整视觉结构", "preserve": "交替背景环、角度射线、描边径向刻度、阶梯填充与轮廓;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "按角度有序的非负半径;源码为随机阶梯面积,不是真正频数直方图;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 25, "end_line": 25, "code": " ax.plot([angle,angle],[radius,100],linewidth=.5,color='white')", "href": "sources/screenshot.polar_step_area/restored.html#L25" }, { "line": 26, "end_line": 26, "code": " ax.text(angle,radius+4*length,str(i),rotation=i-90,rotation_mode='anchor',va='top',ha='center')", "href": "sources/screenshot.polar_step_area/restored.html#L26" }, { "line": 37, "end_line": 37, "code": " ax.fill_between(T,i,i+100,color='#597cab33',zorder=-50)", "href": "sources/screenshot.polar_step_area/restored.html#L37" }, { "line": 38, "end_line": 38, "code": "ax.scatter([0],[0],20,facecolor=bgcolor,edgecolor='#597cab',zorder=1000)", "href": "sources/screenshot.polar_step_area/restored.html#L38" }, { "line": 44, "end_line": 44, "code": "ax.fill(T,R,color='#e6a6a5',zorder=150,alpha=.3)", "href": "sources/screenshot.polar_step_area/restored.html#L44" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "screenshot.polar_area", "display_name": "平滑极坐标面积叠加", "tags": [ "极坐标", "周期", "透明叠加" ], "purpose": "闭合平滑曲线、半透明重叠、深轮廓、空心基座和外置图例,用于angle(度)和多个 value 列的展示。", "data_requirements": [ "angle(度)和多个 value 列;角度严格递增且不重复360°" ], "composition": "闭合平滑曲线、半透明重叠、深轮廓、空心基座和外置图例", "visual_features": [ "闭合平滑曲线", "半透明重叠", "深轮廓", "空心基座和外置图例" ], "adaptation_notes": "代码截图恢复,原数据缺失。原data.csv缺失,补充angle及三个value列的周期合成示例。 增加角度顺序及端点检查,周期样条在0/360处同时闭合值和斜率。 原中心Circle仅创建且使用私有变换;改为实际绘制的白色中心覆盖,保留空心基座。", "number": 141, "kind": "recipe", "legacy_title": "平滑极坐标面积叠加", "legacy_ref": "screenshot #32", "source": { "original_code": "sources/screenshot.polar_area/restored.py", "execution_code": "sources/screenshot.polar_area/restored.py", "recipe_section": "sources/screenshot.polar_area/recipe.md", "recipe_file": "figure_recipes_screenshot.md", "content_sha256": "db9e954f7c234da08f544389e8987dd33534a1b98d40fe9d22a2b6a9e4d8eb1a", "code_sha256": "cebe88538ee6ee0b7fd984a11b9b606b66dbe69b3831145d5779007ae44d9751", "execution_sha256": "cebe88538ee6ee0b7fd984a11b9b606b66dbe69b3831145d5779007ae44d9751", "code_view": "sources/screenshot.polar_area/restored.html", "provenance": "sources/screenshot.polar_area/provenance.json", "source_status": "missing_data", "figure_page": 116, "code_pages": [ 118, 119, 120 ] }, "title_mismatch": false, "compatibility_patches": [ "原data.csv缺失,补充angle及三个value列的周期合成示例。", "增加角度顺序及端点检查,周期样条在0/360处同时闭合值和斜率。", "原中心Circle仅创建且使用私有变换;改为实际绘制的白色中心覆盖,保留空心基座。" ], "preview_scope": "complete_restored_example", "previews": [ { "path": "previews/screenshot.polar_area-1.png", "thumbnail": "thumbnails/screenshot.polar_area-1.jpg", "sha256": "7c54658aa9bb648a3f324df609cc8a9c2b00206810a1344e4f1b9f192d7956c5", "pixels": [ 893, 945 ] } ], "code_evidence": [ { "line": 47, "operation": "fill_between", "code": "ax.fill_between(theta_smooth,BASE_RADIUS,r_values,color=color,alpha=.3,label=f'数据系列{idx+1}')" }, { "line": 48, "operation": "plot", "code": "ax.plot(theta_smooth,r_values,color=color,linewidth=2,alpha=.9)" } ], "literal_colormaps": [], "aliases": [ "polar_area", "新图32", "截图116" ], "related_ids": [], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_source_pages_checked", "statistical_audit": false }, "card_path": "cards/screenshot.polar_area.md", "fidelity_checkpoints": [ { "title": "平滑极坐标面积叠加的完整视觉结构", "preserve": "闭合平滑曲线、半透明重叠、深轮廓、空心基座和外置图例;保留源码中对应的独立绘制层和视觉编码。", "allowed_adaptation": "angle(度)和多个 value 列;角度严格递增且不重复360°;可调整数据、标签、尺寸、视角及配色角色,但各色阶、透明度、轮廓和图例语义需对应。", "evidence": [ { "line": 47, "end_line": 47, "code": " ax.fill_between(theta_smooth,BASE_RADIUS,r_values,color=color,alpha=.3,label=f'数据系列{idx+1}')", "href": "sources/screenshot.polar_area/restored.html#L47" }, { "line": 48, "end_line": 48, "code": " ax.plot(theta_smooth,r_values,color=color,linewidth=2,alpha=.9)", "href": "sources/screenshot.polar_area/restored.html#L48" } ] } ], "fidelity_scope": "恢复适配版的可见视觉层;来源缺口见SOURCE.md" }, { "id": "advanced.grouped_bar_3d", "display_name": "三维分组渐变柱状图", "tags": [ "三维", "柱状", "比较", "误差" ], "purpose": "不同样品在多个实验条件下的测量值及不确定性如何变化?", "data_requirements": [ "行类别×列条件的非负有限数值矩阵", "两轴标签;可选真实对称/非对称误差长度" ], "composition": "单三维轴;二维排列渐变柱、逐柱标签与误差棒;侧边分段色条", "visual_features": [ "白到主题色的分层渐变柱面", "顶面与侧面明暗", "柱顶数值标签", "可选误差棒", "数值分档色条", "正交视角和虚线网格" ], "adaptation_notes": "按用户参考图的既有复现源码适配。示例柱高为标签转录值,误差为示意并已标注;自定义数据不自动补误差。支持非负有限矩阵;三维遮挡较多时需控制组数。分档阈值可不等宽,色条等高块代表档位。", "number": 142, "kind": "recipe", "legacy_title": "三维分组渐变柱状图", "legacy_ref": "advanced #35", "source": { "original_code": "sources/advanced.grouped_bar_3d/original.py", "execution_code": "sources/advanced.grouped_bar_3d/original.py", "recipe_section": "sources/advanced.grouped_bar_3d/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "9a54c13b2e3fc68616e20a682374beac04b9eac39b8decbaa46be9345068e5b8", "code_sha256": "58014f254f4bcddcb4bb6cd5b0c8ec0482667345aa0509e77f76c7c9fc95ec14", "execution_sha256": "58014f254f4bcddcb4bb6cd5b0c8ec0482667345aa0509e77f76c7c9fc95ec14", "code_view": "sources/advanced.grouped_bar_3d/original.html", "provenance": "sources/advanced.grouped_bar_3d/provenance.json" }, "title_mismatch": false, "compatibility_patches": [ "项目配色与可复用矩阵接口;动态坐标、显式误差及数据校验" ], "preview_scope": "complete_reference_adapted_demo", "previews": [ { "path": "previews/advanced.grouped_bar_3d-1.png", "thumbnail": "thumbnails/advanced.grouped_bar_3d-1.jpg", "sha256": "9baf51c64e8ff323d22382487bd8d5076bf8b80528bbc29c21a6a34d57ca66e9", "pixels": [ 4183, 3758 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 115, "operation": "Poly3DCollection", "code": "Poly3DCollection(faces, facecolors=facecolors, edgecolors='none',\n linewidths=0, antialiased=False, zsort='average', zorder=3)" }, { "line": 123, "operation": "plot", "code": "ax.plot([i,i], [j,j], [h-lower[i,j],h+err], c='black', lw=1.25, zorder=5)" }, { "line": 125, "operation": "text", "code": "ax.text(i, j, h+err+label_offset, f'{h:.2f}', ha='center', va='bottom',\n fontsize=10, zorder=6, bbox=dict(facecolor='white', edgecolor='none', alpha=.87, pad=.15))" } ], "literal_colormaps": [], "aliases": [ "3d grouped bar", "gradient bar", "三维误差棒柱状图", "材料掺量对比", "样品条件矩阵" ], "related_ids": [ "basic.grouped_bar", "screenshot.block_surface_3d" ], "review": { "visual": "main_preview_inspected", "code": "drawing_layers_and_input_contract_checked", "statistical_audit": false }, "card_path": "cards/advanced.grouped_bar_3d.md", "fidelity_checkpoints": [ { "feature": "三维梯度柱面与数值分档", "preserve": "保留四面渐变分层、独立顶面明暗、正交视角、逐柱数值、真实数据支持的误差棒与分段色条;柱体和色条必须共用同一分档及颜色映射。", "allowed_adaptation": "可改行列数、数据、真实误差、标签、视角与分档阈值;换色保留白到主题色的柱面渐变,不把分类取色顺序当数值色阶。无真实误差时省略该层。", "evidence": [ { "line": 115, "end_line": 116, "code": " ax.add_collection3d(Poly3DCollection(faces, facecolors=facecolors, edgecolors='none',\n linewidths=0, antialiased=False, zsort='average', zorder=3))", "href": "sources/advanced.grouped_bar_3d/original.html#L115" }, { "line": 123, "end_line": 123, "code": " ax.plot([i,i], [j,j], [h-lower[i,j],h+err], c='black', lw=1.25, zorder=5)", "href": "sources/advanced.grouped_bar_3d/original.html#L123" }, { "line": 125, "end_line": 126, "code": " ax.text(i, j, h+err+label_offset, f'{h:.2f}', ha='center', va='bottom',\n fontsize=10, zorder=6, bbox=dict(facecolor='white', edgecolor='none', alpha=.87, pad=.15))", "href": "sources/advanced.grouped_bar_3d/original.html#L125" }, { "line": 106, "end_line": 106, "code": " c = base if h <= 1.5 else np.ones(3)*(1-t**.65)+base*t**.65", "href": "sources/advanced.grouped_bar_3d/original.html#L106" }, { "line": 142, "end_line": 142, "code": " cb = ColorbarBase(cax, cmap=cmap, norm=norm, boundaries=bounds, ticks=bounds, spacing='uniform')", "href": "sources/advanced.grouped_bar_3d/original.html#L142" }, { "line": 82, "end_line": 82, "code": " scale = LinearSegmentedColormap.from_list('vivid_ordered', palette_colors())", "href": "sources/advanced.grouped_bar_3d/original.html#L82" } ] } ], "fidelity_scope": "基于用户参考图复现版的完整视觉结构;误差数据来源须独立确认。" }, { "id": "advanced.multi_y_gradient_hist", "display_name": "多Y轴渐变直方图与正态拟合", "tags": [ "分布", "比较", "多轴", "渐变" ], "purpose": "多个群体在同一测量变量上的中心、离散程度和分布形状有何区别?", "data_requirements": [ "1–3组同单位原始观测及组名", "每组至少两个等宽箱,可采用错位分箱;可选正态拟合" ], "composition": "单面板重叠渐变直方图;共享X轴、同色独立Y轴与正态拟合虚线", "visual_features": [ "透明到原色的柱体渐变", "组间错位等宽分箱", "三组重叠直方图", "左1右2同色独立Y轴", "正态拟合虚线", "样本量与拟合参数图例" ], "adaptation_notes": "仅效果图重建,未提供原代码或样本;预览为固定种子模拟数据。独立Y轴只能按对应颜色刻度读数,不能直接跨组比柱高;正态拟合可关闭,不代表正态性通过。", "number": 143, "kind": "recipe", "legacy_title": "多Y轴渐变直方图与正态拟合", "legacy_ref": "advanced #36", "source": { "original_code": "sources/advanced.multi_y_gradient_hist/original.py", "execution_code": "sources/advanced.multi_y_gradient_hist/original.py", "recipe_section": "sources/advanced.multi_y_gradient_hist/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "8cbe4dffa748268feb5876bc7bb60d69653b6dabd542871b835606b1b4c4c1fa", "code_sha256": "df18fabca541884c2e16957f8fbe961deb48b421b09257d0f9e664f3b4779f41", "execution_sha256": "df18fabca541884c2e16957f8fbe961deb48b421b09257d0f9e664f3b4779f41", "code_view": "sources/advanced.multi_y_gradient_hist/original.html", "provenance": "sources/advanced.multi_y_gradient_hist/provenance.json" }, "title_mismatch": false, "compatibility_patches": [ "仅图重建;样本为模拟数据;组间错位等宽分箱及频数单位拟合" ], "preview_scope": "complete_synthetic_reconstruction", "previews": [ { "path": "previews/advanced.multi_y_gradient_hist-1.png", "thumbnail": "thumbnails/advanced.multi_y_gradient_hist-1.jpg", "sha256": "f7eb987ae7151616c6059ea9017b0e4f3d7b32b4f0cf0c256b690d07955ad777", "pixels": [ 2787, 2179 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 154, "operation": "PolyCollection", "code": "PolyCollection(vertices, facecolors=facecolors,\n edgecolors='none', antialiased=False,\n transform=ax.transData, zorder=2+({0:.1,1:0.,2:.2}[i]))" }, { "line": 160, "operation": "plot", "code": "host.plot(xfit, yfit, color=color, ls='--', lw=2.2,\n transform=ax.transData, zorder=5)" } ], "literal_colormaps": [], "aliases": [ "multi y histogram", "多y轴渐变图", "三y轴直方图", "残差分布拟合", "多组渐变直方图" ], "related_ids": [ "advanced.multi_y_gradient_hist" ], "review": { "visual": "main_preview_inspected", "code": "counts_normal_fit_scaling_and_axis_transforms_checked", "statistical_audit": false }, "card_path": "cards/advanced.multi_y_gradient_hist.md", "fidelity_checkpoints": [ { "feature": "多轴透明柱与频数拟合", "preserve": "保留柱体真实透明渐变、叠加关系、共享横轴与独立同色Y轴、图例和虚线拟合;每组图层绑定自身Y轴变换,拟合按该组N×该组箱宽换算到频数。", "allowed_adaptation": "可以更换样本、分箱数、配色、标签和不截断的刻度范围;缺少正态假设或零方差时关闭拟合。不能把渐变改成纯色,不能用独立轴柱高声称频数更大。", "evidence": [ { "line": 154, "end_line": 156, "code": " host.add_collection(PolyCollection(vertices, facecolors=facecolors,\n edgecolors='none', antialiased=False,\n transform=ax.transData, zorder=2+({0:.1,1:0.,2:.2}[i])), autolim=False)", "href": "sources/advanced.multi_y_gradient_hist/original.html#L154" }, { "line": 160, "end_line": 161, "code": " host.plot(xfit, yfit, color=color, ls='--', lw=2.2,\n transform=ax.transData, zorder=5)", "href": "sources/advanced.multi_y_gradient_hist/original.html#L160" }, { "line": 153, "end_line": 153, "code": " facecolors.append((*rgb, .02+.76*((k+.5)/64)**.85))", "href": "sources/advanced.multi_y_gradient_hist/original.html#L153" }, { "line": 118, "end_line": 118, "code": " yfit = (len(values)*widths[0]/(sigma*np.sqrt(2*np.pi))", "href": "sources/advanced.multi_y_gradient_hist/original.html#L118" }, { "line": 130, "end_line": 130, "code": " ax.spines['right'].set_position(('axes', 1.+.12*(i-1)))", "href": "sources/advanced.multi_y_gradient_hist/original.html#L130" }, { "line": 140, "end_line": 140, "code": " ax.set_ylabel('Frequency' if i == 0 else '', color='black', fontsize=15, labelpad=6)", "href": "sources/advanced.multi_y_gradient_hist/original.html#L140" } ] } ], "fidelity_scope": "效果图重建版的主要视觉层,不是原研究数据复现。" }, { "id": "advanced.relief_correlation_heatmap", "number": 144, "kind": "recipe", "display_name": "立体方块相关性热图", "tags": [ "三维", "矩阵", "相关", "浮雕" ], "purpose": "多变量之间有哪些正负相关结构与关联强弱差异?", "data_requirements": [ "完整观测数值表,或有效对称Pearson相关矩阵", "2–40个变量及唯一行列标签" ], "composition": "完整矩阵的斜投影浮雕方块;方形正面、双侧壁、行列标签与侧边色条", "visual_features": [ "正方形矩阵正面", "错落浮雕高度", "双侧阴影与细棱线", "矩阵行列标签", "有符号相关性色条" ], "adaptation_notes": "仅效果图重建;演示相关矩阵来自模拟样本。颜色表示Pearson r,高度按r线性增加,这是明确约定而非原图已知规则;侧壁阴影不能代替正面读色。", "legacy_title": "立体方块相关性热图", "legacy_ref": "advanced #37", "source": { "original_code": "sources/advanced.relief_correlation_heatmap/original.py", "execution_code": "sources/advanced.relief_correlation_heatmap/original.py", "recipe_section": "sources/advanced.relief_correlation_heatmap/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "4a4679b41e59c71bfbad6ba47178cdccf3d9cf0770a034b14fdf4bfc562f52eb", "code_sha256": "f72ce056053fd614be7a331b3c818068ac265789a419ba6a20b1250bbe500e66", "execution_sha256": "f72ce056053fd614be7a331b3c818068ac265789a419ba6a20b1250bbe500e66", "code_view": "sources/advanced.relief_correlation_heatmap/original.html", "provenance": "sources/advanced.relief_correlation_heatmap/provenance.json" }, "title_mismatch": false, "compatibility_patches": [ "仅效果图重建;声明高度规则;演示由模拟样本计算相关矩阵" ], "preview_scope": "complete_synthetic_reconstruction", "previews": [ { "path": "previews/advanced.relief_correlation_heatmap-1.png", "thumbnail": "thumbnails/advanced.relief_correlation_heatmap-1.jpg", "sha256": "abc6e4a665c20607c054dce80aff5cd31d13006edbfeedaa96682d416e6e1352", "pixels": [ 3098, 2863 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 90, "operation": "Polygon", "code": "Polygon(points,closed=True,facecolor=color,\n edgecolor='#273641',linewidth=.62,joinstyle='miter')" }, { "line": 92, "operation": "add_patch", "code": "ax.add_patch(polygon)" }, { "line": 105, "operation": "colorbar", "code": "fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),cax=cax,\n ticks=[-1,-.5,0,.5,1])" } ], "literal_colormaps": [], "aliases": [ "3d correlation heatmap", "3d热力图", "立体相关矩阵", "浮雕矩阵", "方块热图" ], "related_ids": [ "competition.correlation_matrix", "screenshot.block_surface_3d" ], "review": { "visual": "main_preview_inspected", "code": "correlation_validity_and_face_color_geometry_checked", "statistical_audit": false }, "card_path": "cards/advanced.relief_correlation_heatmap.md", "fidelity_checkpoints": [ { "feature": "相关矩阵的完整浮雕结构", "preserve": "保留完整矩阵、固定斜投影的方形正面、双侧阴影、细棱线及后到前绘制顺序;正面色与色条严格共用[-1,1]映射,凸起按有符号r的声明公式计算。", "allowed_adaptation": "可替换有效相关矩阵、标签、配色与凸起强度;颜色不受阴影或relief参数重新归一化。保留正负语义,不凭视觉推定缺失数据,不将方块平滑成连续曲面。", "evidence": [ { "line": 90, "end_line": 91, "code": " polygon=Polygon(points,closed=True,facecolor=color,\n edgecolor='#273641',linewidth=.62,joinstyle='miter')", "href": "sources/advanced.relief_correlation_heatmap/original.html#L90" }, { "line": 92, "end_line": 92, "code": " ax.add_patch(polygon)", "href": "sources/advanced.relief_correlation_heatmap/original.html#L92" }, { "line": 105, "end_line": 106, "code": " colorbar=fig.colorbar(ScalarMappable(norm=norm,cmap=cmap),cax=cax,\n ticks=[-1,-.5,0,.5,1])", "href": "sources/advanced.relief_correlation_heatmap/original.html#L105" }, { "line": 60, "end_line": 60, "code": " height=relief*(.12+1.4*(float(r)+1)/2)", "href": "sources/advanced.relief_correlation_heatmap/original.html#L60" }, { "line": 61, "end_line": 61, "code": " face=base+height*np.array([.58,.98])", "href": "sources/advanced.relief_correlation_heatmap/original.html#L61" }, { "line": 85, "end_line": 85, "code": " for row in range(n):", "href": "sources/advanced.relief_correlation_heatmap/original.html#L85" } ] } ], "fidelity_scope": "效果图重建;颜色数据语义及模板自定义高度规则须保留。" }, { "id": "template.shap_dependence", "number": 145, "kind": "complete_template", "display_name": "SHAP重要性蜂群与依赖图组合", "tags": [ "解释", "机器学习", "分布", "非线性", "组合" ], "purpose": "哪些特征影响模型预测,它们的数值变化与SHAP归因有什么关系?", "data_requirements": [ "同一模型输出、同一批样本的数值特征表与SHAP表", "唯一sample_id和变量名;可选带方法说明的阈值" ], "composition": "左侧双横轴重要性柱与蜂群叠加;右侧两列SHAP依赖图;共享特征值色条", "visual_features": [ "双横轴条形蜂群叠加", "透明圆点", "重要性一致排序", "两列依赖面板", "局部趋势、中位数和可选阈值" ], "adaptation_notes": "连续颜色在每个变量内部按min/max归一化,重要性为平均绝对SHAP。模型归因不是因果效应。可替换真实SHAP和特征、标签、top项数及面板数量;阈值须提供数值与来源,默认不推断转折点;性能指标不得照抄截图。", "legacy_title": "SHAP重要性蜂群与依赖图组合", "legacy_ref": null, "title_mismatch": false, "compatibility_patches": [ "效果图重建;合成模型演示" ], "preview_scope": "complete_synthetic_reconstruction", "source": { "original_code": "sources/shap-composites/original.py", "execution_code": "../templates/shap-composites/plot_shap_composites.py", "execution_args": [ "--mode", "dependence" ], "template_description": "../templates/shap-composites/TEMPLATE.md", "code_sha256": "4f34051e9ece8f89f352e876eb289f023a805be8b4e81aabb2ea24a03a0a735f", "execution_sha256": "4f34051e9ece8f89f352e876eb289f023a805be8b4e81aabb2ea24a03a0a735f", "code_view": "sources/shap-composites/original.html", "provenance": "sources/template.shap_dependence/provenance.json" }, "previews": [ { "path": "previews/template.shap_dependence-1.png", "thumbnail": "thumbnails/template.shap_dependence-1.jpg", "sha256": "052a8c7931d8e4f8834e901134d93e311341bf2f5f418b875dc918ab6eec432a", "pixels": [ 2478, 1346 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 194, "operation": "composition", "code": " bars = ax.twiny()" }, { "line": 198, "operation": "composition", "code": " bars.barh(np.arange(len(order)),imp[order],height=.63,color=barcolors," }, { "line": 206, "operation": "composition", "code": " ax.scatter(shap[:,j],row+swarm_offsets(shap[:,j]),c=normalize_feature(x[:,j])," }, { "line": 216, "operation": "composition", "code": " grid = fig.add_gridspec(rows,2,left=.51,right=.93,bottom=.13,top=.88,wspace=.34,hspace=.64)" }, { "line": 220, "operation": "composition", "code": " a.scatter(x[:,j],shap[:,j],c=normalize_feature(x[:,j]),cmap=cmap,vmin=0,vmax=1," }, { "line": 232, "operation": "composition", "code": " a.axvline(value,color=colors[0],ls=':',lw=1.1)" } ], "literal_colormaps": [], "aliases": [ "SHAP组合", "重要性蜂群叠加", "SHAP dependence", "影响因素", "特征响应" ], "related_ids": [ "advanced.shap_summary", "template.shap_contribution" ], "review": { "visual": "main_preview_inspected", "code": "sample_alignment_and_attribution_arithmetic_checked", "statistical_audit": false }, "card_path": "cards/template.shap_dependence.md", "fidelity_checkpoints": [ { "feature": "左侧双横轴重要性柱与蜂群叠加;右侧两列SHAP依赖图;共享特征值色条", "preserve": "保留顶部重要性轴与底部有符号SHAP轴、同一变量行的柱/蜂群叠加、右侧两列依赖图及共享连续色条;散点横坐标不抖动,透明层与趋势线分明。", "allowed_adaptation": "可替换真实SHAP和特征、标签、top项数及面板数量;阈值须提供数值与来源,默认不推断转折点;性能指标不得照抄截图。", "evidence": [ { "line": 194, "end_line": 194, "code": " bars = ax.twiny()", "href": "sources/shap-composites/original.html#L194" }, { "line": 198, "end_line": 198, "code": " bars.barh(np.arange(len(order)),imp[order],height=.63,color=barcolors,", "href": "sources/shap-composites/original.html#L198" }, { "line": 206, "end_line": 206, "code": " ax.scatter(shap[:,j],row+swarm_offsets(shap[:,j]),c=normalize_feature(x[:,j]),", "href": "sources/shap-composites/original.html#L206" }, { "line": 216, "end_line": 216, "code": " grid = fig.add_gridspec(rows,2,left=.51,right=.93,bottom=.13,top=.88,wspace=.34,hspace=.64)", "href": "sources/shap-composites/original.html#L216" }, { "line": 220, "end_line": 220, "code": " a.scatter(x[:,j],shap[:,j],c=normalize_feature(x[:,j]),cmap=cmap,vmin=0,vmax=1,", "href": "sources/shap-composites/original.html#L220" }, { "line": 232, "end_line": 232, "code": " a.axvline(value,color=colors[0],ls=':',lw=1.1)", "href": "sources/shap-composites/original.html#L232" } ] } ], "fidelity_scope": "主要截图结构重建;适配后核对实图。" }, { "id": "template.shap_contribution", "number": 146, "kind": "complete_template", "display_name": "SHAP排名双层贡献环与蜂群组合", "tags": [ "解释", "机器学习", "组成", "排序", "组合" ], "purpose": "单个变量及其所属类别的模型归因贡献分别有多大,影响方向如何分布?", "data_requirements": [ "按sample_id和变量名对应的特征表与SHAP表", "覆盖全部变量的2–6组分类映射" ], "composition": "左侧重要性排名及百分比;空白处嵌双层变量/类别贡献环;右侧同序方形蜂群和连续色条", "visual_features": [ "条形末端数值和全变量占比", "组内色阶", "内变量外类别双环", "嵌入左侧空白区", "与排名逐行对齐的方形蜂群" ], "adaptation_notes": "连续颜色在每个变量内部按min/max归一化,重要性为平均绝对SHAP。模型归因不是因果效应。变量分组必须有实际含义;占比分母和环图均覆盖全部输入变量,top筛选不改变归一化。组贡献采用各变量mean(abs(SHAP))之和,不与有符号组归因混淆。", "legacy_title": "SHAP排名双层贡献环与蜂群组合", "legacy_ref": null, "title_mismatch": false, "compatibility_patches": [ "效果图重建;合成模型演示" ], "preview_scope": "complete_synthetic_reconstruction", "source": { "original_code": "sources/shap-composites/original.py", "execution_code": "../templates/shap-composites/plot_shap_composites.py", "execution_args": [ "--mode", "contribution" ], "template_description": "../templates/shap-composites/TEMPLATE.md", "code_sha256": "4f34051e9ece8f89f352e876eb289f023a805be8b4e81aabb2ea24a03a0a735f", "execution_sha256": "4f34051e9ece8f89f352e876eb289f023a805be8b4e81aabb2ea24a03a0a735f", "code_view": "sources/shap-composites/original.html", "provenance": "sources/template.shap_contribution/provenance.json" }, "previews": [ { "path": "previews/template.shap_contribution-1.png", "thumbnail": "thumbnails/template.shap_contribution-1.jpg", "sha256": "f71d0636016cd9aab745278e26809359dc6a0dbdc7f97136812219d64a061a41", "pixels": [ 2478, 1274 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 272, "operation": "composition", "code": " ax.barh(range(len(order)),importance[order],color=[feature_colors[j] for j in order]," }, { "line": 300, "operation": "composition", "code": " ring.pie(outer,radius=1,startangle=90,counterclock=False," }, { "line": 304, "operation": "composition", "code": " ring.pie(importance[inner],radius=.70,startangle=90,counterclock=False," }, { "line": 321, "operation": "composition", "code": " ax2.scatter(shap[:,j],row+swarm_offsets(shap[:,j],max_width=.25)," }, { "line": 325, "operation": "composition", "code": " ax2.set_ylim(ax.get_ylim()); ax2.set_yticks([])" } ], "literal_colormaps": [], "aliases": [ "SHAP组合", "分组贡献", "双层环图", "SHAP contribution", "特征贡献占比" ], "related_ids": [ "advanced.shap_summary", "template.shap_dependence" ], "review": { "visual": "main_preview_inspected", "code": "sample_alignment_and_attribution_arithmetic_checked", "statistical_audit": false }, "card_path": "cards/template.shap_contribution.md", "fidelity_checkpoints": [ { "feature": "左侧重要性排名及百分比;空白处嵌双层变量/类别贡献环;右侧同序方形蜂群和连续色条", "preserve": "保留排名与右侧蜂群的同一变量顺序及行对齐、条末占比和原始重要性、左侧空白处双层环及白色分隔、组内色阶与方形透明散点。", "allowed_adaptation": "变量分组必须有实际含义;占比分母和环图均覆盖全部输入变量,top筛选不改变归一化。组贡献采用各变量mean(abs(SHAP))之和,不与有符号组归因混淆。", "evidence": [ { "line": 272, "end_line": 272, "code": " ax.barh(range(len(order)),importance[order],color=[feature_colors[j] for j in order],", "href": "sources/shap-composites/original.html#L272" }, { "line": 300, "end_line": 300, "code": " ring.pie(outer,radius=1,startangle=90,counterclock=False,", "href": "sources/shap-composites/original.html#L300" }, { "line": 304, "end_line": 304, "code": " ring.pie(importance[inner],radius=.70,startangle=90,counterclock=False,", "href": "sources/shap-composites/original.html#L304" }, { "line": 321, "end_line": 321, "code": " ax2.scatter(shap[:,j],row+swarm_offsets(shap[:,j],max_width=.25),", "href": "sources/shap-composites/original.html#L321" }, { "line": 325, "end_line": 325, "code": " ax2.set_ylim(ax.get_ylim()); ax2.set_yticks([])", "href": "sources/shap-composites/original.html#L325" } ] } ], "fidelity_scope": "主要截图结构重建;适配后核对实图。" }, { "id": "advanced.radar_ridgeline", "number": 147, "kind": "recipe", "display_name": "雷达山脊融合图", "tags": [ "极坐标", "多维", "比较", "融合" ], "purpose": "多个数据层在一组有序指标上的相对高低和轮廓差异如何?", "data_requirements": [ "5–16个唯一指标及一致排列顺序", "2–4个同尺度数据层;成本型指标先统一方向" ], "composition": "雷达径向骨架上的同心山脊环;独立基准圆、局部峰、逐峰数值与外置图例", "visual_features": [ "径向虚线雷达骨架", "同心独立基准环", "指标方向平滑局部峰", "半透明填充与同色轮廓", "逐峰数值和外围指标名" ], "adaptation_notes": "仅效果图重建;演示值为人工构造。峰高使用全部数据共同归一化,峰宽固定。山脊不是KDE,不表达样本分布、样本量或不确定性。", "legacy_title": "雷达山脊融合图", "legacy_ref": "advanced #38", "source": { "original_code": "sources/advanced.radar_ridgeline/original.py", "execution_code": "sources/advanced.radar_ridgeline/original.py", "recipe_section": "sources/advanced.radar_ridgeline/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "59df6135237a0cd03e4778fd7235af1d5935e02e79011f3a93e29a371ad68239", "code_sha256": "165c7a88d4fba0e790d19e1ad6ae17a38333eba46a69561455992453920d62b2", "execution_sha256": "165c7a88d4fba0e790d19e1ad6ae17a38333eba46a69561455992453920d62b2", "code_view": "sources/advanced.radar_ridgeline/original.html", "provenance": "sources/advanced.radar_ridgeline/provenance.json" }, "title_mismatch": false, "compatibility_patches": [ "仅效果图重建;声明标量峰编码及非KDE含义;接入项目配色和宽表输入" ], "preview_scope": "complete_synthetic_reconstruction", "previews": [ { "path": "previews/advanced.radar_ridgeline-1.png", "thumbnail": "thumbnails/advanced.radar_ridgeline-1.jpg", "sha256": "68cf34d07e15cc5a70facee58c640d19d84d0d499b19c6ab5d6125aac97eebe9", "pixels": [ 2688, 2361 ], "palette_id": "olive-apricot" } ], "code_evidence": [ { "line": 96, "operation": "fill_between", "code": " ax.fill_between(theta, baseline, curve, color=color, alpha=.72, linewidth=0, zorder=2)" }, { "line": 97, "operation": "plot", "code": " ax.plot(theta, curve, color=color, linewidth=1.35, alpha=.95, zorder=3)" }, { "line": 103, "operation": "plot", "code": " ax.plot([angle, angle], [.16, outer_label_radius-.17], color=COLORS['ref_line'],\n linewidth=.7, linestyle=(0, (3, 4)), alpha=.72, zorder=0)" }, { "line": 109, "operation": "text", "code": " ax.text(angle, curve[idx]+.055,\n f'{values[row, column]:{value_format}}{value_suffix}', fontsize=6.8,\n ha='center', va='bottom', color='#30343B', zorder=5)" }, { "line": 121, "operation": "legend", "code": " ax.legend(handles=handles, title='数据层', loc='center left', bbox_to_anchor=(1.03, .52),\n frameon=False, handlelength=1.25, handleheight=1.25, labelspacing=.65,\n fontsize=9.2, title_fontsize=10.2)" } ], "literal_colormaps": [], "aliases": [ "radar ridgeline", "radial ridge", "雷达山脊图", "环形山脊", "极坐标山脊", "雷达融合图" ], "related_ids": [ "competition.radar", "advanced.ridgeline", "screenshot.polar_area" ], "review": { "visual": "main_preview_inspected", "code": "shared_normalization_and_radial_layers_checked", "statistical_audit": false }, "card_path": "cards/advanced.radar_ridgeline.md", "fidelity_checkpoints": [ { "feature": "雷达骨架上的同心标量山脊", "preserve": "保留每层独立基准圆环、指标方向平滑局部峰、半透明填充与同色轮廓、径向虚线、逐峰数值和外置图例;所有层使用同一个全局归一化尺度。", "allowed_adaptation": "可替换指标、数据层、数值、数值后缀与项目配色;可按类别数调整峰宽及画布。不能将各层分别归一化后声称环间峰高可比,也不能把标量峰描述为样本密度。", "evidence": [ { "line": 96, "end_line": 96, "code": " ax.fill_between(theta, baseline, curve, color=color, alpha=.72, linewidth=0, zorder=2)", "href": "sources/advanced.radar_ridgeline/original.html#L96" }, { "line": 97, "end_line": 97, "code": " ax.plot(theta, curve, color=color, linewidth=1.35, alpha=.95, zorder=3)", "href": "sources/advanced.radar_ridgeline/original.html#L97" }, { "line": 103, "end_line": 104, "code": " ax.plot([angle, angle], [.16, outer_label_radius-.17], color=COLORS['ref_line'],\n linewidth=.7, linestyle=(0, (3, 4)), alpha=.72, zorder=0)", "href": "sources/advanced.radar_ridgeline/original.html#L103" }, { "line": 109, "end_line": 111, "code": " ax.text(angle, curve[idx]+.055,\n f'{values[row, column]:{value_format}}{value_suffix}', fontsize=6.8,\n ha='center', va='bottom', color='#30343B', zorder=5)", "href": "sources/advanced.radar_ridgeline/original.html#L109" }, { "line": 121, "end_line": 123, "code": " ax.legend(handles=handles, title='数据层', loc='center left', bbox_to_anchor=(1.03, .52),\n frameon=False, handlelength=1.25, handleheight=1.25, labelspacing=.65,\n fontsize=9.2, title_fontsize=10.2)", "href": "sources/advanced.radar_ridgeline/original.html#L121" } ] } ], "fidelity_scope": "效果图重建;共同数值尺度、独立圆环和非KDE语义须保留。" }, { "id": "advanced.grouped_radial_bar", "number": 148, "kind": "recipe", "display_name": "环形分组柱状对比图", "tags": [ "比较", "极坐标", "分组", "层级" ], "purpose": "同一任务中,重点方法与多个基线的表现如何?同时展示任务与大类的层级。", "data_requirements": [ "2–16个任务、2–8个方法,最多96根柱;有限非负数值", "数值宽表与任务、大类、说明表;任务名称唯一且一一对应,同一大类连续排列", "参考默认按任务独立缩放柱长,只能组内比较;跨任务读取原始数值或在源码中选择共享尺度" ], "composition": "空心中心标题;11组参考柱;宽重点柱与4档基线柱;组间留白;旋转值和任务说明;外圈大类弧线", "visual_features": [ "宽重点柱与窄基线柱", "组间留白和中心留白", "逐柱原始数值与沿圆周文字", "外圈层级分类弧线", "重点色与基线同色系梯度" ], "adaptation_notes": "按用户参考图重建布局;演示数值逐项从图片读入,未独立核验原实验。参考模式把每任务最小、最大值映射到固定柱长区间,不表示跨任务绝对值或面积比例。配色读取项目粉彩少女及其他色板。", "legacy_title": "环形分组柱状对比图", "legacy_ref": "advanced #39", "source": { "original_code": "sources/advanced.grouped_radial_bar/original.py", "execution_code": "sources/advanced.grouped_radial_bar/original.py", "recipe_section": "sources/advanced.grouped_radial_bar/recipe.md", "recipe_file": "figure_recipes_advanced.md", "content_sha256": "070cb9838b4a82de94b63fc43a1541113d538debbe52a8e9bf7e09bf0a5286e3", "code_sha256": "b841ac3770978acd3d1a89681708a7ae1847a01611e210be730063f649566304", "execution_sha256": "b841ac3770978acd3d1a89681708a7ae1847a01611e210be730063f649566304", "code_view": "sources/advanced.grouped_radial_bar/original.html", "provenance": "sources/advanced.grouped_radial_bar/provenance.json" }, "title_mismatch": false, "compatibility_patches": [ "参考图结构重建;以项目配色替换原紫蓝,显式记录任务内柱长缩放规则" ], "preview_scope": "complete_reference_reconstruction", "previews": [ { "path": "previews/advanced.grouped_radial_bar-1.png", "thumbnail": "thumbnails/advanced.grouped_radial_bar-1.jpg", "sha256": "648f69d294f3b38161c9c202caa68886016b027768d3ed3b2562307285b8b208", "pixels": [ 2662, 2504 ], "palette_id": "pastel-girl" } ], "code_evidence": [ { "line": 213, "operation": "text", "code": " ax.text(.5, .5, title, transform=ax.transAxes, ha='center', va='center',\n fontsize=fontsize, fontfamily=fonts, fontweight='bold', color=colors[highlight_index], zorder=9)" }, { "line": 183, "operation": "text", "code": " ax.text(angle, task_radius, textwrap.fill(task, width=wrap_width), ha='center', va='center',\n rotation=rotation, rotation_mode='anchor', fontfamily=fonts,\n fontsize=14 if dense else 17, fontweight='bold', color=ink, zorder=7)" }, { "line": 165, "operation": "bar", "code": " ax.bar(angle, length, width=widths[model], bottom=bottom, color=color,\n edgecolor='none', linewidth=0, zorder=3)" }, { "line": 188, "operation": "text", "code": " ax.text(angle, detail_radius, detail,\n ha='center', va='center', rotation=rotation, rotation_mode='anchor',\n fontfamily=fonts, fontsize=detail_font, color=ink, zorder=7)" }, { "line": 234, "operation": "legend", "code": " legend = fig.legend(handles, labels, handler_map={tuple: TopAlignedTuple(ndivide=None, pad=.10)},\n loc='upper left', bbox_to_anchor=(.012, .981), borderaxespad=0,\n frameon=False, fontsize=15.8, handlelength=1.15,\n handleheight=1.0, labelspacing=.35, handletextpad=.6)" }, { "line": 197, "operation": "plot", "code": " ax.plot(theta, np.full_like(theta, 570), color=arc_color, linewidth=2.5, zorder=1)" } ], "literal_colormaps": [], "aliases": [ "环形分组柱状图", "径向分组柱状图", "环形模型对比", "circular grouped bar", "grouped radial bar", "GroundingPI" ], "related_ids": [ "screenshot.radial_bars", "basic.grouped_bar", "competition.radar" ], "review": { "visual": "main_preview_inspected", "code": "reference_geometry_and_within_task_encoding_checked", "statistical_audit": false }, "card_path": "cards/advanced.grouped_radial_bar.md", "fidelity_checkpoints": [ { "feature": "参考图环形分组与层级标注", "preserve": "保留宽重点柱、基线色阶、组间间距、中心留白、原始数值、旋转任务名和说明、大类弧线及图例;不能用单系列玫瑰图代替。", "allowed_adaptation": "可替换任务、方法、分组、说明、中心文字与配色。默认任务内缩放只能用于组内比较;跨任务比较改用共享尺度并明确说明,不排序或遗漏输入方法。", "evidence": [ { "line": 213, "end_line": 214, "code": " ax.text(.5, .5, title, transform=ax.transAxes, ha='center', va='center',\n fontsize=fontsize, fontfamily=fonts, fontweight='bold', color=colors[highlight_index], zorder=9)", "href": "sources/advanced.grouped_radial_bar/original.html#L213" }, { "line": 183, "end_line": 185, "code": " ax.text(angle, task_radius, textwrap.fill(task, width=wrap_width), ha='center', va='center',\n rotation=rotation, rotation_mode='anchor', fontfamily=fonts,\n fontsize=14 if dense else 17, fontweight='bold', color=ink, zorder=7)", "href": "sources/advanced.grouped_radial_bar/original.html#L183" }, { "line": 165, "end_line": 166, "code": " ax.bar(angle, length, width=widths[model], bottom=bottom, color=color,\n edgecolor='none', linewidth=0, zorder=3)", "href": "sources/advanced.grouped_radial_bar/original.html#L165" }, { "line": 188, "end_line": 190, "code": " ax.text(angle, detail_radius, detail,\n ha='center', va='center', rotation=rotation, rotation_mode='anchor',\n fontfamily=fonts, fontsize=detail_font, color=ink, zorder=7)", "href": "sources/advanced.grouped_radial_bar/original.html#L188" }, { "line": 234, "end_line": 237, "code": " legend = fig.legend(handles, labels, handler_map={tuple: TopAlignedTuple(ndivide=None, pad=.10)},\n loc='upper left', bbox_to_anchor=(.012, .981), borderaxespad=0,\n frameon=False, fontsize=15.8, handlelength=1.15,\n handleheight=1.0, labelspacing=.35, handletextpad=.6)", "href": "sources/advanced.grouped_radial_bar/original.html#L234" }, { "line": 197, "end_line": 197, "code": " ax.plot(theta, np.full_like(theta, 570), color=arc_color, linewidth=2.5, zorder=1)", "href": "sources/advanced.grouped_radial_bar/original.html#L197" } ] } ], "fidelity_scope": "参考图重建。柱长按任务内独立区间缩放,标签始终是原值;实际实验结论未审计。" } ] }