From 6d35d51999c2a6c225152167b52be3a4948014eb Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Fri, 15 Nov 2024 10:22:47 +0000 Subject: [PATCH] Set `.matplotlibrc` across all notebooks --- .matplotlibrc | 4 ++++ examples/1-basic/density.ipynb | 6 ++++++ examples/1-basic/lensing.ipynb | 6 ++++++ examples/1-basic/matter.ipynb | 6 ++++++ examples/1-basic/photoz.ipynb | 6 ++++++ examples/1-basic/shells.ipynb | 6 ++++++ examples/2-advanced/cosmic_shear.ipynb | 6 ++++++ examples/2-advanced/stage_4_galaxies.ipynb | 6 ++++++ 8 files changed, 46 insertions(+) create mode 100644 .matplotlibrc diff --git a/.matplotlibrc b/.matplotlibrc new file mode 100644 index 00000000..3628ab7c --- /dev/null +++ b/.matplotlibrc @@ -0,0 +1,4 @@ +backend: agg +figure.dpi: 100 +font.family: DejaVu Sans +savefig.dpi: 100 diff --git a/examples/1-basic/density.ipynb b/examples/1-basic/density.ipynb index 0933b150..dbdc5fda 100644 --- a/examples/1-basic/density.ipynb +++ b/examples/1-basic/density.ipynb @@ -25,6 +25,9 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from matplotlib.colors import LogNorm\n", @@ -37,6 +40,9 @@ "import glass\n", "import glass.ext.camb\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/1-basic/lensing.ipynb b/examples/1-basic/lensing.ipynb index 4200f8a8..caf9bb00 100644 --- a/examples/1-basic/lensing.ipynb +++ b/examples/1-basic/lensing.ipynb @@ -30,7 +30,10 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", "import healpy as hp\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -42,6 +45,9 @@ "import glass\n", "import glass.ext.camb\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/1-basic/matter.ipynb b/examples/1-basic/matter.ipynb index 5bca55f3..43e802e5 100644 --- a/examples/1-basic/matter.ipynb +++ b/examples/1-basic/matter.ipynb @@ -26,7 +26,10 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", "import healpy as hp\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -38,6 +41,9 @@ "import glass\n", "import glass.ext.camb\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/1-basic/photoz.ipynb b/examples/1-basic/photoz.ipynb index f7862a95..c0bce57f 100644 --- a/examples/1-basic/photoz.ipynb +++ b/examples/1-basic/photoz.ipynb @@ -27,6 +27,9 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -36,6 +39,9 @@ "# how many arcmin2 over the entire sphere\n", "ARCMIN2_SPHERE = 60**6 // 100 / np.pi\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/1-basic/shells.ipynb b/examples/1-basic/shells.ipynb index 1902df73..1240e971 100644 --- a/examples/1-basic/shells.ipynb +++ b/examples/1-basic/shells.ipynb @@ -29,6 +29,9 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -39,6 +42,9 @@ "import glass\n", "import glass.ext.camb\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/2-advanced/cosmic_shear.ipynb b/examples/2-advanced/cosmic_shear.ipynb index 739f8129..0f5b5adc 100644 --- a/examples/2-advanced/cosmic_shear.ipynb +++ b/examples/2-advanced/cosmic_shear.ipynb @@ -25,7 +25,10 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", "import healpy as hp\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -40,6 +43,9 @@ "# how many arcmin2 over the entire sphere\n", "ARCMIN2_SPHERE = 60**6 // 100 / np.pi\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n", diff --git a/examples/2-advanced/stage_4_galaxies.ipynb b/examples/2-advanced/stage_4_galaxies.ipynb index 70014850..f7fbb88c 100644 --- a/examples/2-advanced/stage_4_galaxies.ipynb +++ b/examples/2-advanced/stage_4_galaxies.ipynb @@ -28,7 +28,10 @@ "metadata": {}, "outputs": [], "source": [ + "import pathlib\n", + "\n", "import healpy as hp\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -40,6 +43,9 @@ "import glass\n", "import glass.ext.camb\n", "\n", + "# set up matplotlib to produce consistent figures\n", + "mpl.rc_file(pathlib.Path.cwd().parents[1] / \".matplotlibrc\")\n", + "\n", "# creating a numpy random number generator for sampling\n", "rng = np.random.default_rng(seed=42)\n", "\n",