diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8c50ad0..7d05348 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -48,8 +48,6 @@ jobs: sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml # make -C fonts/ - cp -r fonts/ /usr/share/fonts/ - fc-cache make all - name: Run checks run: | diff --git a/.gitignore b/.gitignore index 3761438..299692b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ handout-*.png # ---------------------------------- figures/*.pdf fonts/**/*.[ot]tf +fonts/__pycache__/ # html build docs/_build/* diff --git a/README.md b/README.md index a9d07d5..ead6d18 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Beginner handout [(download pdf)](https://matplotlib.org/cheatsheets/handout-beg ## How to compile -1. You need to create a `fonts` repository with: +1. You need to fill the `fonts` directory with: * `fonts/roboto/*` : See https://fonts.google.com/specimen/Roboto or https://github.com/googlefonts/roboto/tree/master/src/hinted @@ -35,17 +35,6 @@ On Linux, with `make` installed, the fonts can be set up with the following comm make -C fonts ``` -The fonts can be made discoverable by `matplotlib` (through `fontconfig`) by creating the following in `$HOME/.config/fontconfig/fonts.conf` (see [here](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html)): - -```xml - - - -/path/to/cheatsheets/fonts/ -... - -``` - 2. You need to generate all the figures: diff --git a/fonts/custom_fonts.py b/fonts/custom_fonts.py new file mode 100644 index 0000000..3cba97b --- /dev/null +++ b/fonts/custom_fonts.py @@ -0,0 +1,8 @@ +from pathlib import Path + +from matplotlib.font_manager import fontManager + + +HERE = Path(__file__).parent.resolve() +for font in HERE.glob('*/*.[ot]tf'): + fontManager.addfont(font) diff --git a/scripts/adjustements.py b/scripts/adjustements.py index 26f9559..12788ff 100644 --- a/scripts/adjustements.py +++ b/scripts/adjustements.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/advanced-plots.py b/scripts/advanced-plots.py index f598087..3ab496f 100644 --- a/scripts/advanced-plots.py +++ b/scripts/advanced-plots.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Script to generate all the advanced plots +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/anatomy.py b/scripts/anatomy.py index e8f95cc..bf26640 100644 --- a/scripts/anatomy.py +++ b/scripts/anatomy.py @@ -3,6 +3,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/annotate.py b/scripts/annotate.py index 6535368..f485299 100644 --- a/scripts/annotate.py +++ b/scripts/annotate.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(6, 1)) # ax = plt.subplot(111, frameon=False, aspect=.1) diff --git a/scripts/annotation-arrow-styles.py b/scripts/annotation-arrow-styles.py index 26ac950..dc6fad0 100644 --- a/scripts/annotation-arrow-styles.py +++ b/scripts/annotation-arrow-styles.py @@ -1,3 +1,4 @@ +import sys import pathlib import matplotlib.pyplot as plt @@ -5,6 +6,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + styles = mpatches.ArrowStyle.get_styles() diff --git a/scripts/annotation-connection-styles.py b/scripts/annotation-connection-styles.py index 057b5cd..f2210e3 100644 --- a/scripts/annotation-connection-styles.py +++ b/scripts/annotation-connection-styles.py @@ -1,3 +1,4 @@ +import sys import pathlib import matplotlib as mpl @@ -5,6 +6,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/basic-plots.py b/scripts/basic-plots.py index 8350326..325423b 100644 --- a/scripts/basic-plots.py +++ b/scripts/basic-plots.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Script to generate all the basic plots +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/colorbar.py b/scripts/colorbar.py index 6ffba8f..4a27820 100644 --- a/scripts/colorbar.py +++ b/scripts/colorbar.py @@ -3,6 +3,7 @@ # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(6, .65)) # ax = plt.subplot(111, frameon=False, aspect=.1) diff --git a/scripts/colormaps.py b/scripts/colormaps.py index 8858299..e27d52c 100644 --- a/scripts/colormaps.py +++ b/scripts/colormaps.py @@ -1,3 +1,4 @@ +import sys import pathlib import numpy as np @@ -5,6 +6,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + figsize = 4.0, 0.25 fig = plt.figure(figsize=figsize) diff --git a/scripts/colornames.py b/scripts/colornames.py index a059787..09aff9f 100644 --- a/scripts/colornames.py +++ b/scripts/colornames.py @@ -5,6 +5,7 @@ Simple plot example with the named colors and its visual representation. """ +import sys import pathlib import matplotlib as mpl @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/colors.py b/scripts/colors.py index 1bd76f8..26c8f8b 100644 --- a/scripts/colors.py +++ b/scripts/colors.py @@ -3,6 +3,7 @@ # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + figsize = 4.0, 0.25 fig = plt.figure(figsize=figsize) diff --git a/scripts/extents.py b/scripts/extents.py index 2eab814..59da360 100644 --- a/scripts/extents.py +++ b/scripts/extents.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/fonts.py b/scripts/fonts.py index 7d39e10..d167e2e 100644 --- a/scripts/fonts.py +++ b/scripts/fonts.py @@ -2,12 +2,16 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import matplotlib.pyplot as plt ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(4.25, 3.8)) ax = fig.add_axes([0, 0, 1, 1], frameon=False, xticks=[], yticks=[], @@ -17,13 +21,13 @@ # ----------------------------------------------------------------------------- variants = { - "normal" : "../fonts/eb-garamond/EBGaramond08-Regular.otf", - "small-caps" : "../fonts/eb-garamond/EBGaramondSC08-Regular.otf" + "normal": "EB Garamond", + "small-caps": "EB Garamond SC", } text = "The quick brown fox jumps over the lazy dog" -for i, (variant, file) in enumerate(variants.items()): - ax.text(1, y, text, size=9, va="center", font=pathlib.Path(file).resolve()) +for i, (variant, family) in enumerate(variants.items()): + ax.text(1, y, text, size=9, va="center", family=family) ax.text(39, y, variant, color="0.25", va="center", ha="right", diff --git a/scripts/interpolations.py b/scripts/interpolations.py index 3cd1308..69053ab 100644 --- a/scripts/interpolations.py +++ b/scripts/interpolations.py @@ -1,3 +1,4 @@ +import sys import pathlib import matplotlib as mpl @@ -6,6 +7,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/layouts.py b/scripts/layouts.py index 49f7340..904bf23 100644 --- a/scripts/layouts.py +++ b/scripts/layouts.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(0.4, 0.4)) margin = 0.01 diff --git a/scripts/legend.py b/scripts/legend.py index 5faf885..e0665cd 100644 --- a/scripts/legend.py +++ b/scripts/legend.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/linestyles.py b/scripts/linestyles.py index 6f9deaa..f913cc3 100644 --- a/scripts/linestyles.py +++ b/scripts/linestyles.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -9,6 +10,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(4.25, 2*.55)) ax = fig.add_axes([0, 0, 1, 1], xlim=[0.75, 10.25], ylim=[0.5, 2.5], frameon=False, diff --git a/scripts/markers.py b/scripts/markers.py index 48f1d01..88c6768 100644 --- a/scripts/markers.py +++ b/scripts/markers.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -9,6 +10,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + # Markers # ----------------------------------------------------------------------------- diff --git a/scripts/plot-variations.py b/scripts/plot-variations.py index 65b9ff1..79a5339 100644 --- a/scripts/plot-variations.py +++ b/scripts/plot-variations.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib # Scripts to generate all the basic plots @@ -11,6 +12,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/projections.py b/scripts/projections.py index 1f623a9..ad00f43 100644 --- a/scripts/projections.py +++ b/scripts/projections.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/scales.py b/scripts/scales.py index 70192ca..c2bab2a 100644 --- a/scripts/scales.py +++ b/scripts/scales.py @@ -1,3 +1,4 @@ +import sys import pathlib import numpy as np @@ -5,6 +6,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(0.4, 2/3*0.4)) ax = fig.add_axes([0, 0, 1, 1], frameon=False) diff --git a/scripts/sine.py b/scripts/sine.py index 0e6a347..6b61dc0 100644 --- a/scripts/sine.py +++ b/scripts/sine.py @@ -2,6 +2,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/styles.py b/scripts/styles.py index bedf9d9..a94e5e8 100644 --- a/scripts/styles.py +++ b/scripts/styles.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + for style in ['default'] + plt.style.available: with plt.style.context(style): diff --git a/scripts/text-alignments.py b/scripts/text-alignments.py index 0d653b9..36727d8 100644 --- a/scripts/text-alignments.py +++ b/scripts/text-alignments.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -9,6 +10,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + dpi = 100 fig = plt.figure(figsize=(4.25, 1.5), dpi=dpi) diff --git a/scripts/tick-formatters.py b/scripts/tick-formatters.py index bcdce04..d8a535e 100644 --- a/scripts/tick-formatters.py +++ b/scripts/tick-formatters.py @@ -3,6 +3,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import matplotlib.pyplot as plt @@ -10,6 +11,8 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa # Setup a plot such that only the bottom spine is shown diff --git a/scripts/tick-locators.py b/scripts/tick-locators.py index 4c0985c..36059c6 100644 --- a/scripts/tick-locators.py +++ b/scripts/tick-locators.py @@ -3,6 +3,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,8 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa # Setup a plot such that only the bottom spine is shown diff --git a/scripts/tick-multiple-locator.py b/scripts/tick-multiple-locator.py index 2976a63..9a71f0c 100644 --- a/scripts/tick-multiple-locator.py +++ b/scripts/tick-multiple-locator.py @@ -3,6 +3,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -12,6 +13,8 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa mpl.style.use([ ROOT_DIR / 'styles/base.mplstyle', diff --git a/scripts/tip-color-range.py b/scripts/tip-color-range.py index 5743940..3f10ee6 100644 --- a/scripts/tip-color-range.py +++ b/scripts/tip-color-range.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Scripts to generate all the basic plots +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(2, 2)) mpl.rcParams['axes.linewidth'] = 1.5 diff --git a/scripts/tip-colorbar.py b/scripts/tip-colorbar.py index 9e8da79..4fd78be 100644 --- a/scripts/tip-colorbar.py +++ b/scripts/tip-colorbar.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Scripts to generate all the basic plots +import sys import pathlib import numpy as np @@ -13,6 +14,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(2.15, 2)) mpl.rcParams['axes.linewidth'] = 1.5 diff --git a/scripts/tip-dotted.py b/scripts/tip-dotted.py index 8f52a2c..3af68d2 100644 --- a/scripts/tip-dotted.py +++ b/scripts/tip-dotted.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Scripts to generate all the basic plots +import sys import pathlib import numpy as np @@ -12,6 +13,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(5, .25)) diff --git a/scripts/tip-dual-axis.py b/scripts/tip-dual-axis.py index 9d72f34..a6ea0b8 100644 --- a/scripts/tip-dual-axis.py +++ b/scripts/tip-dual-axis.py @@ -1,3 +1,4 @@ +import sys import pathlib import numpy as np @@ -6,6 +7,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.rcParams['axes.linewidth'] = 1.5 diff --git a/scripts/tip-font-family.py b/scripts/tip-font-family.py index 53564ac..9dadb25 100644 --- a/scripts/tip-font-family.py +++ b/scripts/tip-font-family.py @@ -3,6 +3,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -11,6 +12,8 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa # Setup a plot such that only the bottom spine is shown diff --git a/scripts/tip-hatched.py b/scripts/tip-hatched.py index f1a38d4..68b4881 100644 --- a/scripts/tip-hatched.py +++ b/scripts/tip-hatched.py @@ -1,3 +1,4 @@ +import sys import pathlib import numpy as np @@ -5,6 +6,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + cmap = plt.get_cmap("Oranges") color1, color2 = cmap(0.3), cmap(0.5) diff --git a/scripts/tip-multiline.py b/scripts/tip-multiline.py index 99d704c..b89b1ef 100644 --- a/scripts/tip-multiline.py +++ b/scripts/tip-multiline.py @@ -2,6 +2,7 @@ # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -10,6 +11,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.rcParams['axes.linewidth'] = 1.5 diff --git a/scripts/tip-outline.py b/scripts/tip-outline.py index 6fe1a6f..0cac539 100644 --- a/scripts/tip-outline.py +++ b/scripts/tip-outline.py @@ -4,6 +4,7 @@ # ----------------------------------------------------------------------------- # Scripts to generate all the basic plots +import sys import pathlib import numpy as np @@ -13,6 +14,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + fig = plt.figure(figsize=(2, 2)) mpl.rcParams['axes.linewidth'] = 1.5 diff --git a/scripts/tip-post-processing.py b/scripts/tip-post-processing.py index 3280efe..4f3c810 100644 --- a/scripts/tip-post-processing.py +++ b/scripts/tip-post-processing.py @@ -1,3 +1,4 @@ +import sys import pathlib import numpy as np @@ -8,6 +9,9 @@ ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + # First pass for drop-shadow fig = Figure(figsize=(6, 1.5)) diff --git a/scripts/tip-transparency.py b/scripts/tip-transparency.py index 320ea0c..a172821 100644 --- a/scripts/tip-transparency.py +++ b/scripts/tip-transparency.py @@ -2,6 +2,7 @@ # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- +import sys import pathlib import numpy as np @@ -9,6 +10,9 @@ import matplotlib.pyplot as plt ROOT_DIR = pathlib.Path(__file__).parent.parent +sys.path.append(str(ROOT_DIR / "fonts")) +import custom_fonts # noqa + mpl.rc('axes', linewidth=1.5)