Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-398: consistent plotting for notebooks #425

Merged
merged 10 commits into from
Nov 28, 2024
4 changes: 4 additions & 0 deletions .matplotlibrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
backend: agg
figure.dpi: 100
font.family: DejaVu Sans
savefig.dpi: 100
6 changes: 6 additions & 0 deletions examples/1-basic/density.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/1-basic/lensing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/1-basic/matter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/1-basic/photoz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/1-basic/shells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/2-advanced/cosmic_shear.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions examples/2-advanced/stage_4_galaxies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
paddyroddy marked this conversation as resolved.
Show resolved Hide resolved
"# creating a numpy random number generator for sampling\n",
"rng = np.random.default_rng(seed=42)\n",
"\n",
Expand Down