From 30ecb6a88ac6d2529ff0b3b398e6d6f6e4442913 Mon Sep 17 00:00:00 2001 From: nuluh Date: Sat, 30 Aug 2025 08:11:29 +0700 Subject: [PATCH] feat(notebooks): Add matplotlib configuration for SVG font rendering in plots to use string only with no embedded fonts --- code/notebooks/stft.ipynb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/notebooks/stft.ipynb b/code/notebooks/stft.ipynb index ef8418a..2b18b9b 100644 --- a/code/notebooks/stft.ipynb +++ b/code/notebooks/stft.ipynb @@ -419,6 +419,7 @@ "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", + "import matplotlib as mpl\n", "from typing import Union" ] }, @@ -447,6 +448,7 @@ " plt.ylabel('Sampel Frekuensi (Hz)')\n", " plt.xticks(np.linspace(0, len(data)-1, x_num_ticks)) # Set x-ticks at regular intervals\n", " plt.yticks(np.linspace(0, len(data.columns)-1, y_num_ticks)) # Set y-ticks at regular intervals\n", + " mpl.rcParams['svg.fonttype'] = None\n", " plt.savefig(\"output_single.svg\", format=\"svg\", dpi=100)\n", " plt.show()\n", "\n", @@ -477,6 +479,7 @@ " # Adjust layout\n", " # plt.tight_layout(rect=[0.05, 0.05, 1, 1]) # Leave space for shared labels\n", " plt.subplots_adjust(left=0.1, right=0.75, top=0.9, bottom=0.1, wspace=0.2, hspace=0.2)\n", + " mpl.rcParams['svg.fonttype'] = None\n", " plt.savefig(\"output_multiple.svg\", format=\"svg\", dpi=80)\n", " plt.show()" ]