The script src/21-gravity/make_fig_rar.py of the validation package of the paper 21-grav, rendered with an anchor per line. ▶ run the predicates on Google Colab.
1"""Figure: the registration crossover / radial acceleration relation (ledger D4, Fig.~\\ref{fig:rar}).23g_obs = g_N / (1 - e^{-sqrt(g_N/a0)}); deep slope 1/2 (deep-MOND sqrt(g_N a0)),4Newtonian slope 1, knee at the floor a0 = c H0 / 2pi. The continuum curve is the5[approx] reading of the exact registration fraction f = 1 - eta^a (validate_deepregime.py).6"""7import pathlib, numpy as np, matplotlib8matplotlib.use("Agg")9import matplotlib.pyplot as plt10FIG = pathlib.Path(__file__).resolve().parent.parent / "figures"11plt.rcParams.update({"font.family":"serif","mathtext.fontset":"cm","font.size":11,12 "axes.linewidth":0.8,"figure.dpi":150})1314x = np.logspace(-3,3,800)15y = x/(1.0-np.exp(-np.sqrt(x)))16fig,ax=plt.subplots(figsize=(5.4,4.2))17ax.plot(x,x,ls="--",lw=1.0,color="0.55",label=r"Newtonian $g_{\mathrm{obs}}=g_N$ (slope 1)")18ax.plot(x,np.sqrt(x),ls="-.",lw=1.0,color="0.55",label=r"deep-MOND $\sqrt{g_N a_0}$ (slope $\frac{1}{2}$)")19ax.plot(x,y,lw=2.2,color="#1f4e79",label=r"$g_{\mathrm{obs}}=g_N/(1-e^{-\sqrt{g_N/a_0}})$")20ax.axvline(1.0,ls=":",lw=0.9,color="#b00020")21ax.annotate(r"knee at $g_N=a_0=cH_0/2\pi$",xy=(1.0,1.6),xytext=(2.2,0.18),22 textcoords="data",fontsize=9,color="#b00020",23 arrowprops=dict(arrowstyle="->",color="#b00020",lw=0.8))24ax.annotate("slope 1",xy=(220,220),fontsize=9,color="0.35",rotation=33)25ax.annotate("slope 1/2",xy=(2e-3,0.10),fontsize=9,color="0.35",rotation=20)26ax.set_xscale("log");ax.set_yscale("log")27ax.set_xlim(1e-3,1e3);ax.set_ylim(3e-2,1e3)28ax.set_xlabel(r"$g_N/a_0$ (baryonic acceleration)")29ax.set_ylabel(r"$g_{\mathrm{obs}}/a_0$ (registered acceleration)")30ax.legend(loc="upper left",fontsize=8.3,frameon=False,handlelength=2.4)31ax.grid(True,which="major",ls="-",lw=0.4,color="0.9")32ax.grid(True,which="minor",ls="-",lw=0.25,color="0.95")33ax.text(0.98,0.03,"[approx] continuum reading of the exact\nregistration fraction $f=1-\\eta^{a}$",34 transform=ax.transAxes,ha="right",va="bottom",fontsize=7.2,color="0.4")35fig.tight_layout()36fig.savefig(str(FIG/"fig_rar.pdf"),bbox_inches="tight")37fig.savefig(str(FIG/"fig_rar.png"),bbox_inches="tight",dpi=150)38print("wrote", FIG/"fig_rar.pdf")39