From d42b03071be62cc580150d4d480262534c632cf0 Mon Sep 17 00:00:00 2001 From: Takahiro OHKUBO Date: Wed, 15 Jul 2026 07:42:54 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9B=B3=E3=81=AB=E7=B5=B1=E8=A8=88=E6=83=85?= =?UTF-8?q?=E5=A0=B1=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analyze_lab_placement_survey.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/analyze_lab_placement_survey.py b/analyze_lab_placement_survey.py index 618187c..c05f0ba 100755 --- a/analyze_lab_placement_survey.py +++ b/analyze_lab_placement_survey.py @@ -443,7 +443,6 @@ def plot_data(data, lower=10, upper=None, target_lab=10, bin_width=10): import matplotlib.pyplot as plt df = data.copy() - df = filter_plot_data(df, lower=lower, upper=upper) labs = sorted(df["研究室番号"].unique()) target_values = df.loc[df["研究室番号"] == @@ -465,6 +464,23 @@ def plot_data(data, lower=10, upper=None, target_lab=10, bin_width=10): draw_gp_histogram(axs[1], df, target_values, bin_width, colors[0], colors[3]) + describe_text = df["値"].describe() + describe_text = describe_text.to_string(float_format=lambda x: f"{x:.1f}") + # 下段ヒストグラムの右上に describe() を表示 + axs[1].text( + 0.01, 0.99, # Axes 内の右上 + describe_text, + transform=axs[1].transAxes, + ha="left", va="top", fontsize=8, + fontfamily="monospace", # 桁を揃える + bbox={ + "facecolor": "white", + "edgecolor": "gray", + "alpha": 0.85, + "boxstyle": "round,pad=0.2", + }, + zorder=1, + ) for ax in axs: style_axis(ax)