| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # ── Parameters ───────────────────────────────────────────────────────────── | |
| seed = 2903 | |
| n_points = 141 | |
| # ── Data ──────────────────────────────────────────────────────────────────── | |
| x = np.linspace(0.0, 2.0 * np.pi, n_points) | |
| y0 = 1.857967 * np.sin(0.942220 * x + 5.084951) | |
| y1 = 0.590013 * np.sin(1.142741 * x + 0.572998) | |
| y2 = 1.924395 * np.sin(1.682643 * x + 4.928356) | |
| # ── Plot ──────────────────────────────────────────────────────────────────── | |
| fig, ax = plt.subplots(figsize=(7, 4)) | |
| ax.plot(x, y0, color="tab:blue", label="A=1.86, f=0.94, φ=5.08") | |
| ax.plot(x, y1, color="tab:orange", label="A=0.59, f=1.14, φ=0.57") | |
| ax.plot(x, y2, color="tab:green", label="A=1.92, f=1.68, φ=4.93") | |
| ax.set_xlabel("x") | |
| ax.set_ylabel("y") | |
| ax.set_title("Sinusoidal Line Plot (3 curve(s))") | |
| ax.legend(fontsize=8) | |
| ax.grid(True, alpha=0.3) | |
| fig.tight_layout() | |
| plt.show() | |