diff options
author | Patrik Müller <patrik.mueller@ost.ch> | 2022-07-15 16:24:48 +0200 |
---|---|---|
committer | Patrik Müller <patrik.mueller@ost.ch> | 2022-07-15 16:24:48 +0200 |
commit | 7a8795dcb555a551fd09a3c9b15002675e30891f (patch) | |
tree | 4913f47695788cc05778a4326ba5ca44b6eb0046 /buch/papers/laguerre/scripts/rel_error_range.py | |
parent | First version of section 'Gauss Quadratur', fix to gamma_approx.py when z=0 (diff) | |
download | SeminarSpezielleFunktionen-7a8795dcb555a551fd09a3c9b15002675e30891f.tar.gz SeminarSpezielleFunktionen-7a8795dcb555a551fd09a3c9b15002675e30891f.zip |
Change image scripts to PDF format, update Makefile, add complex plane plot
Diffstat (limited to 'buch/papers/laguerre/scripts/rel_error_range.py')
-rw-r--r-- | buch/papers/laguerre/scripts/rel_error_range.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/buch/papers/laguerre/scripts/rel_error_range.py b/buch/papers/laguerre/scripts/rel_error_range.py index 7c74d76..43b5450 100644 --- a/buch/papers/laguerre/scripts/rel_error_range.py +++ b/buch/papers/laguerre/scripts/rel_error_range.py @@ -1,13 +1,21 @@ if __name__ == "__main__": + import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy.special import gamma_approx as ga - - N = 1001 - xmin = -5 - xmax = 5 + + mpl.rcParams.update( + { + "mathtext.fontset": "stix", + "font.family": "serif", + "font.serif": "TeX Gyre Termes", + } + ) + N = 1201 + xmax = 6 + xmin = -xmax ns = np.arange(2, 12, 2) ylim = np.array([-11, -1.2]) @@ -20,13 +28,14 @@ if __name__ == "__main__": ax.semilogy(x, np.abs(rel_err), label=f"$n={n}$") ax.set_xlim(x[0], x[-1]) ax.set_ylim(*(10.0 ** ylim)) - ax.set_xticks(np.arange(xmin + 1, xmax, 2)) - ax.set_xticks(np.arange(xmin, xmax), minor=True) + ax.set_xticks(np.arange(xmin, xmax + ga.EPSILON, 2)) + ax.set_xticks(np.arange(xmin, xmax + ga.EPSILON), minor=True) ax.set_yticks(10.0 ** np.arange(*ylim, 2)) - ax.set_yticks(10.0 ** np.arange(*ylim, 1), minor=True) + ax.set_yticks(10.0 ** np.arange(*ylim, 1), "", minor=True) ax.set_xlabel(r"$z$") # ax.set_ylabel("Relativer Fehler") ax.legend(ncol=1, loc="upper left", fontsize=ga.fontsize) ax.grid(1, "both") - fig.savefig(f"{ga.img_path}/rel_error_range.pgf") + # fig.savefig(f"{ga.img_path}/rel_error_range.pgf") + fig.savefig(f"{ga.img_path}/rel_error_range.pdf") # plt.show() |