"""SCI Figure Hub — TGA / DTG Dual-Y Thermal Analysis Plot (CC0-1.0)""" PALETTE = ["#1D4E89", "#E64B35"] import numpy as np import matplotlib.pyplot as plt TGA_COL, DTG_COL = PALETTE[0], PALETTE[1] plt.rcParams.update({"font.sans-serif": ["Arial", "DejaVu Sans"], "font.size": 8, "pdf.fonttype": 42}) T = np.linspace(30, 800, 400) wt = 100 - 8 / (1 + np.exp(-(T - 110) / 14)) - 42 / (1 + np.exp(-(T - 430) / 22)) dtg = np.gradient(wt, T) fig, ax1 = plt.subplots(figsize=(3.6, 2.5), dpi=300) ax2 = ax1.twinx() ax1.plot(T, wt, color=TGA_COL, lw=1.6, label="TGA") ax2.plot(T, dtg, "--", color=DTG_COL, lw=1.2, label="DTG") ax1.set_xlabel("Temperature (°C)") ax1.set_ylabel("Weight (%)", color=TGA_COL) ax2.set_ylabel("Derivative Weight (% °C⁻¹)", color=DTG_COL) ax1.tick_params(axis="y", colors=TGA_COL) ax2.tick_params(axis="y", colors=DTG_COL) ax1.spines["top"].set_visible(False) ax2.spines["top"].set_visible(False) ax1.text(140, 94, "-8.0% (H₂O)", fontsize=7, color=TGA_COL) ax1.text(520, 56, "-42.0% (Ligand)", fontsize=7, color=TGA_COL) fig.tight_layout() fig.savefig("tga_dtg.pdf", bbox_inches="tight")