diff options
author | Andreas Müller <andreas.mueller@ost.ch> | 2022-07-19 18:48:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 18:48:09 +0200 |
commit | 97448d520134eed27c72cd60221910d5d2191ec9 (patch) | |
tree | 414029c38e3faa222e9ba08645d4305996b4fd48 /buch/papers/laguerre/scripts/integrand.py | |
parent | makefile fix (diff) | |
parent | Correct typos, improve grammar (diff) | |
download | SeminarSpezielleFunktionen-97448d520134eed27c72cd60221910d5d2191ec9.tar.gz SeminarSpezielleFunktionen-97448d520134eed27c72cd60221910d5d2191ec9.zip |
Merge pull request #23 from p1mueller/master
Erster Entwurf Laguerre
Diffstat (limited to 'buch/papers/laguerre/scripts/integrand.py')
-rw-r--r-- | buch/papers/laguerre/scripts/integrand.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/buch/papers/laguerre/scripts/integrand.py b/buch/papers/laguerre/scripts/integrand.py new file mode 100644 index 0000000..e970721 --- /dev/null +++ b/buch/papers/laguerre/scripts/integrand.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +# -*- coding:utf-8 -*- +"""Plot for integrand of gamma function with shifting terms.""" + +if __name__ == "__main__": + import os + from pathlib import Path + + import matplotlib as mpl + import matplotlib.pyplot as plt + import numpy as np + + mpl.rcParams.update( + { + "mathtext.fontset": "stix", + "font.family": "serif", + "font.serif": "TeX Gyre Termes", + } + ) + + EPSILON = 1e-12 + xlims = np.array([-3, 3]) + + root = str(Path(__file__).parent) + img_path = f"{root}/../images" + os.makedirs(img_path, exist_ok=True) + + t = np.logspace(*xlims, 1001)[:, None] + + z = np.array([-4.5, -2, -1, -0.5, 0.0, 0.5, 1, 2, 4.5]) + r = t ** z + + fig, ax = plt.subplots(num=1, clear=True, constrained_layout=True, figsize=(4, 2.4)) + ax.semilogx(t, r) + ax.set_xlim(*(10.0 ** xlims)) + ax.set_ylim(1e-3, 40) + ax.set_xlabel(r"$x$") + # ax.set_ylabel(r"$x^z$") + ax.grid(1, "both") + labels = [f"$z={zi: 3.1f}$" for zi in np.squeeze(z)] + ax.legend(labels, ncol=2, loc="upper left", fontsize="small") + fig.savefig(f"{img_path}/integrand.pdf") |