|
26 | 26 | "metadata": {}, |
27 | 27 | "outputs": [], |
28 | 28 | "source": [ |
29 | | - "import numpy as np, matplotlib.pyplot as plt\n", |
| 29 | + "import numpy as np\n", |
| 30 | + "import matplotlib.pyplot as plt\n", |
30 | 31 | "from palatini_pt.equivalence.flux_ratio import flux_ratio_FRW\n", |
31 | 32 | "\n", |
| 33 | + "# (可選)為了 Colab 更保險,明確指定使用 mathtext 而不是外部 TeX\n", |
| 34 | + "import matplotlib as mpl\n", |
| 35 | + "mpl.rcParams[\"text.usetex\"] = False\n", |
| 36 | + "mpl.rcParams[\"mathtext.fontset\"] = \"stix\" # or 'dejavusans'\n", |
| 37 | + "mpl.rcParams[\"font.family\"] = \"STIXGeneral\" # 視字型可用性而定\n", |
| 38 | + "\n", |
32 | 39 | "R = np.linspace(5.0, 80.0, 60)\n", |
33 | 40 | "out = flux_ratio_FRW(R, {\"flux\": {\"sigma\": 1.0, \"c\": 0.5}})\n", |
34 | 41 | "plt.plot(out[\"R\"], out[\"R_DBI_CM\"])\n", |
35 | 42 | "plt.axhline(1.0, ls=\"--\")\n", |
36 | | - "plt.xlabel(\"R\"); plt.ylabel(r\"$\\mathcal R_{X/Y}$\")\n", |
37 | | - "plt.title(\"Flux ratio → 1 with $R^{-\\sigma}$ tail\")\n", |
| 43 | + "plt.xlabel(\"R\")\n", |
| 44 | + "plt.ylabel(r\"$\\mathcal{R}_{X/Y}$\") # <— 加上大括號\n", |
| 45 | + "plt.title(r\"Flux ratio → 1 with $R^{-\\sigma}$ tail\") # <— 用 raw string\n", |
| 46 | + "plt.tight_layout()\n", |
38 | 47 | "plt.show()" |
39 | 48 | ] |
40 | 49 | } |
|
0 commit comments