migliora qualità plot induttori: figura più grande, font, box equazione
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ad94eef400
commit
dce0e85fb6
6 files changed
+59
-30
No files matched your search
+19
-10
@@ -49,22 +49,31 @@ t_curve = np.linspace(T0, T_END, 500)
|
||||
T_curve = modello(t_curve, *popt)
|
||||
|
||||
# --- Plot ---
|
||||
fig, ax = plt.subplots(figsize=(8, 5))
|
||||
fig, ax = plt.subplots(figsize=(10, 6))
|
||||
|
||||
ax.scatter(t_fit, T_fit,
|
||||
color="steelblue", s=20, zorder=3, label="Dati raw (temp_obj)")
|
||||
color="steelblue", s=60, edgecolors="white", linewidths=0.5,
|
||||
zorder=3, label="Dati raw (temp_obj)")
|
||||
ax.plot(t_curve, T_curve,
|
||||
color="tomato", linewidth=2,
|
||||
label=f"Fit: {T_INF} + {A_fit:.2f}·exp(-(t−{T0})/{tau_fit:.3f})")
|
||||
color="tomato", linewidth=2.5,
|
||||
label=f"Fit esponenziale")
|
||||
|
||||
ax.set_xlabel("Tempo [s]")
|
||||
ax.set_ylabel("Temperatura [°C]")
|
||||
ax.set_title(f"Fit esponenziale [{T0}–{T_END} s] | R² = {r2:.4f}")
|
||||
ax.legend()
|
||||
ax.grid(True, alpha=0.3)
|
||||
ax.set_xlabel("Tempo [s]", fontsize=13)
|
||||
ax.set_ylabel("Temperatura [°C]", fontsize=13)
|
||||
ax.set_title(f"Induttore 1 — Fit esponenziale [{T0}–{T_END} s]", fontsize=14, fontweight="bold")
|
||||
ax.tick_params(labelsize=11)
|
||||
ax.legend(fontsize=11, framealpha=0.9)
|
||||
ax.grid(True, which="both", alpha=0.3)
|
||||
ax.minorticks_on()
|
||||
|
||||
eq_text = (f"$T(t) = {T_INF} + {A_fit:.2f}\\cdot e^{{-(t-{T0})/{tau_fit:.3f}}}$\n"
|
||||
f"$R^2 = {r2:.4f}$")
|
||||
ax.text(0.97, 0.95, eq_text, transform=ax.transAxes,
|
||||
fontsize=11, verticalalignment="top", horizontalalignment="right",
|
||||
bbox=dict(boxstyle="round,pad=0.4", facecolor="white", alpha=0.8))
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(Path(__file__).parent / "induttore1.png", dpi=150, bbox_inches="tight")
|
||||
plt.savefig(Path(__file__).parent / "induttore1.png", dpi=200, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
# --- Report ---
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 126 KiB |
+20
-10
@@ -49,19 +49,29 @@ t_curve = np.linspace(T0, T_END, 500)
|
||||
T_curve = modello(t_curve, *popt)
|
||||
|
||||
# --- Plot ---
|
||||
fig, ax = plt.subplots(figsize=(8, 5))
|
||||
fig, ax = plt.subplots(figsize=(10, 6))
|
||||
ax.scatter(t_fit, T_fit,
|
||||
color="steelblue", s=20, zorder=3, label="Dati raw (temp_obj)")
|
||||
color="steelblue", s=60, edgecolors="white", linewidths=0.5,
|
||||
zorder=3, label="Dati raw (temp_obj)")
|
||||
ax.plot(t_curve, T_curve,
|
||||
color="tomato", linewidth=2,
|
||||
label=f"Fit: {T_INF} + {A_fit:.2f}·exp(-(t-{T0})/{tau_fit:.3f})")
|
||||
ax.set_xlabel("Tempo [s]")
|
||||
ax.set_ylabel("Temperatura [°C]")
|
||||
ax.set_title(f"Fit esponenziale [{T0}–{T_END} s] | R² = {r2:.4f}")
|
||||
ax.legend()
|
||||
ax.grid(True, alpha=0.3)
|
||||
color="tomato", linewidth=2.5,
|
||||
label="Fit esponenziale")
|
||||
ax.set_xlabel("Tempo [s]", fontsize=13)
|
||||
ax.set_ylabel("Temperatura [°C]", fontsize=13)
|
||||
ax.set_title(f"Induttore 2 — Fit esponenziale [{T0}–{T_END} s]", fontsize=14, fontweight="bold")
|
||||
ax.tick_params(labelsize=11)
|
||||
ax.legend(fontsize=11, framealpha=0.9)
|
||||
ax.grid(True, which="both", alpha=0.3)
|
||||
ax.minorticks_on()
|
||||
|
||||
eq_text = (f"$T(t) = {T_INF} + {A_fit:.2f}\\cdot e^{{-(t-{T0})/{tau_fit:.3f}}}$\n"
|
||||
f"$R^2 = {r2:.4f}$")
|
||||
ax.text(0.97, 0.95, eq_text, transform=ax.transAxes,
|
||||
fontsize=11, verticalalignment="top", horizontalalignment="right",
|
||||
bbox=dict(boxstyle="round,pad=0.4", facecolor="white", alpha=0.8))
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(Path(__file__).parent / "induttore2.png", dpi=150, bbox_inches="tight")
|
||||
plt.savefig(Path(__file__).parent / "induttore2.png", dpi=200, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
# --- Report ---
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 117 KiB |
+20
-10
@@ -59,21 +59,31 @@ t_curve = np.linspace(T0, T_END, 500)
|
||||
T_curve = modello(t_curve, *popt)
|
||||
|
||||
# --- Plot ---
|
||||
fig, ax = plt.subplots(figsize=(8, 5))
|
||||
fig, ax = plt.subplots(figsize=(10, 6))
|
||||
ax.scatter(t_fit, T_fit,
|
||||
color="steelblue", s=20, zorder=3, label="Dati raw (temp_obj)")
|
||||
color="steelblue", s=60, edgecolors="white", linewidths=0.5,
|
||||
zorder=3, label="Dati raw (temp_obj)")
|
||||
ax.axvspan(W0_START, W0_END, color="orange", alpha=0.25,
|
||||
label=f"Zona esclusa [{W0_START}–{W0_END} s]")
|
||||
ax.plot(t_curve, T_curve,
|
||||
color="tomato", linewidth=2,
|
||||
label=f"Fit: {T_INF} + {A_fit:.2f}·exp(-(t-{T0})/{tau_fit:.3f})")
|
||||
ax.set_xlabel("Tempo [s]")
|
||||
ax.set_ylabel("Temperatura [°C]")
|
||||
ax.set_title(f"Fit esponenziale [{T0}–{T_END} s] | R² = {r2:.4f}")
|
||||
ax.legend()
|
||||
ax.grid(True, alpha=0.3)
|
||||
color="tomato", linewidth=2.5,
|
||||
label="Fit esponenziale")
|
||||
ax.set_xlabel("Tempo [s]", fontsize=13)
|
||||
ax.set_ylabel("Temperatura [°C]", fontsize=13)
|
||||
ax.set_title(f"Induttore 3 — Fit esponenziale [{T0}–{T_END} s]", fontsize=14, fontweight="bold")
|
||||
ax.tick_params(labelsize=11)
|
||||
ax.legend(fontsize=11, framealpha=0.9)
|
||||
ax.grid(True, which="both", alpha=0.3)
|
||||
ax.minorticks_on()
|
||||
|
||||
eq_text = (f"$T(t) = {T_INF} + {A_fit:.2f}\\cdot e^{{-(t-{T0})/{tau_fit:.3f}}}$\n"
|
||||
f"$R^2 = {r2:.4f}$")
|
||||
ax.text(0.97, 0.95, eq_text, transform=ax.transAxes,
|
||||
fontsize=11, verticalalignment="top", horizontalalignment="right",
|
||||
bbox=dict(boxstyle="round,pad=0.4", facecolor="white", alpha=0.8))
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(Path(__file__).parent / "induttore3.png", dpi=150, bbox_inches="tight")
|
||||
plt.savefig(Path(__file__).parent / "induttore3.png", dpi=200, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
||||
# --- Report ---
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 158 KiB |
Reference in new issue
Block a user