We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
sphinx-gallery: 2d/plot_filters
the wavelets does not display.

Please close this issue only when you're happy with the sphinx-gallery.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/2d/plot_filters.py`
Content:
```
1 """
2 Plot the 2D wavelet filters
3 ===========================
4 See :meth:`scattering.scattering1d.filter_bank` for more informations about the used wavelets.
5 """
6 
7 import numpy as np
8 import matplotlib.pyplot as plt
9 from kymatio.scattering2d.filter_bank import filter_bank
10 from kymatio.scattering2d.utils import fft2
11 
12 
13 ###############################################################################
14 # Initial parameters of the filter bank
15 # -------------------------------------
16 M = 32
17 J = 3
18 L = 8
19 filters_set = filter_bank(M, M, J, L=L)
20 
21 
22 ###############################################################################
23 # Imshow complex images
24 # -------------------------------------
25 # Thanks to https://stackoverflow.com/questions/17044052/mathplotlib-imshow-complex-2d-array
26 from colorsys import hls_to_rgb
27 def colorize(z):
28     n, m = z.shape
29     c = np.zeros((n, m, 3))
30     c[np.isinf(z)] = (1.0, 1.0, 1.0)
31     c[np.isnan(z)] = (0.5, 0.5, 0.5)
32 
33     idx = ~(np.isinf(z) + np.isnan(z))
34     A = (np.angle(z[idx]) + np.pi) / (2*np.pi)
35     A = (A + 0.5) % 1.0
36     B =  1.0/(1.0+abs(z[idx])**0.3)
37     c[idx] = [hls_to_rgb(a, b, 0.8) for a,b in zip(A,B)]
38     return c
39 
40 fig, axs = plt.subplots(J+1, L, sharex=True, sharey=True)
41 plt.rc('text', usetex=True)
42 plt.rc('font', family='serif')
43 
44 ###############################################################################
45 # Bandpass filters
46 # ----------------
47 # First, we display each wavelets according to each scale and orientation.
48 i=0
49 for filter in filters_set['psi']:
50     f_r = filter[0][...,0].numpy()
51     f_i = filter[0][..., 1].numpy()
52     f = f_r + 1j*f_i
53     filter_c = fft2(f)
54     filter_c = np.fft.fftshift(filter_c)
55     axs[i // L, i % L].imshow(colorize(filter_c))
56     axs[i // L, i % L].axis('off')
57     axs[i // L, i % L].set_title("$j = {}$ \n $\\theta={}".format(i // L, i % L))
58     i = i+1
59 
60 
61 # Add blanks for pretty display
62 for z in range(L):
63     axs[i // L, i % L].axis('off')
64     i = i+1
65 
66 ###############################################################################
67 # Lowpass filter
68 # ----------------
69 # We finally display the Gaussian filter.
70 f_r = filters_set['phi'][0][...,0].numpy()
71 f_i = filters_set['phi'][0][..., 1].numpy()
72 f = f_r + 1j*f_i
73 filter_c = fft2(f)
74 filter_c = np.fft.fftshift(filter_c)
75 axs[J, L // 2].imshow(colorize(filter_c))
76 
77 # Final caption.
78 fig.suptitle("Wavelets for each scales $j$ and angles $\\theta$ used, with the corresponding low-pass filter."
79              "\n The contrast corresponds to the amplitude and the color to the phase.", fontsize=13)
80 
81 
82 plt.show()
83
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/2d/plot_filters.py b/examples/2d/plot_filters.py
--- a/examples/2d/plot_filters.py
+++ b/examples/2d/plot_filters.py
@@ -1,11 +1,11 @@
 """
 Plot the 2D wavelet filters
 ===========================
-See :meth:`scattering.scattering1d.filter_bank` for more informations about the used wavelets.
+See :meth:`kymatio.scattering2d.filter_bank` for more informations about the used wavelets.
 """
 
-import numpy as np
 import matplotlib.pyplot as plt
+import numpy as np
 from kymatio.scattering2d.filter_bank import filter_bank
 from kymatio.scattering2d.utils import fft2
 
@@ -18,10 +18,9 @@
 L = 8
 filters_set = filter_bank(M, M, J, L=L)
 
-
 ###############################################################################
 # Imshow complex images
-# -------------------------------------
+# ---------------------
 # Thanks to https://stackoverflow.com/questions/17044052/mathplotlib-imshow-complex-2d-array
 from colorsys import hls_to_rgb
 def colorize(z):
@@ -37,14 +36,15 @@
     c[idx] = [hls_to_rgb(a, b, 0.8) for a,b in zip(A,B)]
     return c
 
-fig, axs = plt.subplots(J+1, L, sharex=True, sharey=True)
-plt.rc('text', usetex=True)
-plt.rc('font', family='serif')
-
 ###############################################################################
 # Bandpass filters
 # ----------------
-# First, we display each wavelets according to each scale and orientation.
+# First, we display each wavelet according to its scale and orientation.
+fig, axs = plt.subplots(J, L, sharex=True, sharey=True)
+fig.set_figheight(6)
+fig.set_figwidth(6)
+plt.rc('text', usetex=True)
+plt.rc('font', family='serif')
 i=0
 for filter in filters_set['psi']:
     f_r = filter[0][...,0].numpy()
@@ -54,29 +54,30 @@
     filter_c = np.fft.fftshift(filter_c)
     axs[i // L, i % L].imshow(colorize(filter_c))
     axs[i // L, i % L].axis('off')
-    axs[i // L, i % L].set_title("$j = {}$ \n $\\theta={}".format(i // L, i % L))
+    axs[i // L, i % L].set_title("$j = {}$ \n $\\theta={}$".format(i // L, i % L))
     i = i+1
 
-
-# Add blanks for pretty display
-for z in range(L):
-    axs[i // L, i % L].axis('off')
-    i = i+1
+fig.suptitle("Wavelets for each scales $j$ and angles $\\theta$ used."
+"\n Color saturation and color hue respectively denote complex magnitude and complex phase.", fontsize=13)
+fig.show()
 
 ###############################################################################
 # Lowpass filter
-# ----------------
-# We finally display the Gaussian filter.
-f_r = filters_set['phi'][0][...,0].numpy()
+# --------------
+# We finally display the low-pass filter.
+plt.figure()
+plt.rc('text', usetex=True)
+plt.rc('font', family='serif')
+plt.axis('off')
+plt.set_cmap('gray_r')
+
+f_r = filters_set['phi'][0][..., 0].numpy()
 f_i = filters_set['phi'][0][..., 1].numpy()
 f = f_r + 1j*f_i
+
 filter_c = fft2(f)
 filter_c = np.fft.fftshift(filter_c)
-axs[J, L // 2].imshow(colorize(filter_c))
-
-# Final caption.
-fig.suptitle("Wavelets for each scales $j$ and angles $\\theta$ used, with the corresponding low-pass filter."
-             "\n The contrast corresponds to the amplitude and the color to the phase.", fontsize=13)
-
-
-plt.show()
+plt.suptitle("The corresponding low-pass filter, also known as scaling function."
+"Color saturation and color hue respectively denote complex magnitude and complex phase", fontsize=13)
+filter_c = np.abs(filter_c)
+plt.imshow(filter_c)

{"golden_diff": "diff --git a/examples/2d/plot_filters.py b/examples/2d/plot_filters.py\n--- a/examples/2d/plot_filters.py\n+++ b/examples/2d/plot_filters.py\n@@ -1,11 +1,11 @@\n \"\"\"\n Plot the 2D wavelet filters\n ===========================\n-See :meth:`scattering.scattering1d.filter_bank` for more informations about the used wavelets.\n+See :meth:`kymatio.scattering2d.filter_bank` for more informations about the used wavelets.\n \"\"\"\n \n-import numpy as np\n import matplotlib.pyplot as plt\n+import numpy as np\n from kymatio.scattering2d.filter_bank import filter_bank\n from kymatio.scattering2d.utils import fft2\n \n@@ -18,10 +18,9 @@\n L = 8\n filters_set = filter_bank(M, M, J, L=L)\n \n-\n ###############################################################################\n # Imshow complex images\n-# -------------------------------------\n+# ---------------------\n # Thanks to https://stackoverflow.com/questions/17044052/mathplotlib-imshow-complex-2d-array\n from colorsys import hls_to_rgb\n def colorize(z):\n@@ -37,14 +36,15 @@\n     c[idx] = [hls_to_rgb(a, b, 0.8) for a,b in zip(A,B)]\n     return c\n \n-fig, axs = plt.subplots(J+1, L, sharex=True, sharey=True)\n-plt.rc('text', usetex=True)\n-plt.rc('font', family='serif')\n-\n ###############################################################################\n # Bandpass filters\n # ----------------\n-# First, we display each wavelets according to each scale and orientation.\n+# First, we display each wavelet according to its scale and orientation.\n+fig, axs = plt.subplots(J, L, sharex=True, sharey=True)\n+fig.set_figheight(6)\n+fig.set_figwidth(6)\n+plt.rc('text', usetex=True)\n+plt.rc('font', family='serif')\n i=0\n for filter in filters_set['psi']:\n     f_r = filter[0][...,0].numpy()\n@@ -54,29 +54,30 @@\n     filter_c = np.fft.fftshift(filter_c)\n     axs[i // L, i % L].imshow(colorize(filter_c))\n     axs[i // L, i % L].axis('off')\n-    axs[i // L, i % L].set_title(\"$j = {}$ \\n $\\\\theta={}\".format(i // L, i % L))\n+    axs[i // L, i % L].set_title(\"$j = {}$ \\n $\\\\theta={}$\".format(i // L, i % L))\n     i = i+1\n \n-\n-# Add blanks for pretty display\n-for z in range(L):\n-    axs[i // L, i % L].axis('off')\n-    i = i+1\n+fig.suptitle(\"Wavelets for each scales $j$ and angles $\\\\theta$ used.\"\n+\"\\n Color saturation and color hue respectively denote complex magnitude and complex phase.\", fontsize=13)\n+fig.show()\n \n ###############################################################################\n # Lowpass filter\n-# ----------------\n-# We finally display the Gaussian filter.\n-f_r = filters_set['phi'][0][...,0].numpy()\n+# --------------\n+# We finally display the low-pass filter.\n+plt.figure()\n+plt.rc('text', usetex=True)\n+plt.rc('font', family='serif')\n+plt.axis('off')\n+plt.set_cmap('gray_r')\n+\n+f_r = filters_set['phi'][0][..., 0].numpy()\n f_i = filters_set['phi'][0][..., 1].numpy()\n f = f_r + 1j*f_i\n+\n filter_c = fft2(f)\n filter_c = np.fft.fftshift(filter_c)\n-axs[J, L // 2].imshow(colorize(filter_c))\n-\n-# Final caption.\n-fig.suptitle(\"Wavelets for each scales $j$ and angles $\\\\theta$ used, with the corresponding low-pass filter.\"\n-             \"\\n The contrast corresponds to the amplitude and the color to the phase.\", fontsize=13)\n-\n-\n-plt.show()\n+plt.suptitle(\"The corresponding low-pass filter, also known as scaling function.\"\n+\"Color saturation and color hue respectively denote complex magnitude and complex phase\", fontsize=13)\n+filter_c = np.abs(filter_c)\n+plt.imshow(filter_c)\n", "issue": "sphinx-gallery: 2d/plot_filters\nthe wavelets does not display.\r\n\r\nPlease close this issue only when you're happy with the sphinx-gallery.\n", "before_files": [{"content": "\"\"\"\nPlot the 2D wavelet filters\n===========================\nSee :meth:`scattering.scattering1d.filter_bank` for more informations about the used wavelets.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom kymatio.scattering2d.filter_bank import filter_bank\nfrom kymatio.scattering2d.utils import fft2\n\n\n###############################################################################\n# Initial parameters of the filter bank\n# -------------------------------------\nM = 32\nJ = 3\nL = 8\nfilters_set = filter_bank(M, M, J, L=L)\n\n\n###############################################################################\n# Imshow complex images\n# -------------------------------------\n# Thanks to https://stackoverflow.com/questions/17044052/mathplotlib-imshow-complex-2d-array\nfrom colorsys import hls_to_rgb\ndef colorize(z):\n    n, m = z.shape\n    c = np.zeros((n, m, 3))\n    c[np.isinf(z)] = (1.0, 1.0, 1.0)\n    c[np.isnan(z)] = (0.5, 0.5, 0.5)\n\n    idx = ~(np.isinf(z) + np.isnan(z))\n    A = (np.angle(z[idx]) + np.pi) / (2*np.pi)\n    A = (A + 0.5) % 1.0\n    B =  1.0/(1.0+abs(z[idx])**0.3)\n    c[idx] = [hls_to_rgb(a, b, 0.8) for a,b in zip(A,B)]\n    return c\n\nfig, axs = plt.subplots(J+1, L, sharex=True, sharey=True)\nplt.rc('text', usetex=True)\nplt.rc('font', family='serif')\n\n###############################################################################\n# Bandpass filters\n# ----------------\n# First, we display each wavelets according to each scale and orientation.\ni=0\nfor filter in filters_set['psi']:\n    f_r = filter[0][...,0].numpy()\n    f_i = filter[0][..., 1].numpy()\n    f = f_r + 1j*f_i\n    filter_c = fft2(f)\n    filter_c = np.fft.fftshift(filter_c)\n    axs[i // L, i % L].imshow(colorize(filter_c))\n    axs[i // L, i % L].axis('off')\n    axs[i // L, i % L].set_title(\"$j = {}$ \\n $\\\\theta={}\".format(i // L, i % L))\n    i = i+1\n\n\n# Add blanks for pretty display\nfor z in range(L):\n    axs[i // L, i % L].axis('off')\n    i = i+1\n\n###############################################################################\n# Lowpass filter\n# ----------------\n# We finally display the Gaussian filter.\nf_r = filters_set['phi'][0][...,0].numpy()\nf_i = filters_set['phi'][0][..., 1].numpy()\nf = f_r + 1j*f_i\nfilter_c = fft2(f)\nfilter_c = np.fft.fftshift(filter_c)\naxs[J, L // 2].imshow(colorize(filter_c))\n\n# Final caption.\nfig.suptitle(\"Wavelets for each scales $j$ and angles $\\\\theta$ used, with the corresponding low-pass filter.\"\n             \"\\n The contrast corresponds to the amplitude and the color to the phase.\", fontsize=13)\n\n\nplt.show()\n", "path": "examples/2d/plot_filters.py"}], "after_files": [{"content": "\"\"\"\nPlot the 2D wavelet filters\n===========================\nSee :meth:`kymatio.scattering2d.filter_bank` for more informations about the used wavelets.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom kymatio.scattering2d.filter_bank import filter_bank\nfrom kymatio.scattering2d.utils import fft2\n\n\n###############################################################################\n# Initial parameters of the filter bank\n# -------------------------------------\nM = 32\nJ = 3\nL = 8\nfilters_set = filter_bank(M, M, J, L=L)\n\n###############################################################################\n# Imshow complex images\n# ---------------------\n# Thanks to https://stackoverflow.com/questions/17044052/mathplotlib-imshow-complex-2d-array\nfrom colorsys import hls_to_rgb\ndef colorize(z):\n    n, m = z.shape\n    c = np.zeros((n, m, 3))\n    c[np.isinf(z)] = (1.0, 1.0, 1.0)\n    c[np.isnan(z)] = (0.5, 0.5, 0.5)\n\n    idx = ~(np.isinf(z) + np.isnan(z))\n    A = (np.angle(z[idx]) + np.pi) / (2*np.pi)\n    A = (A + 0.5) % 1.0\n    B =  1.0/(1.0+abs(z[idx])**0.3)\n    c[idx] = [hls_to_rgb(a, b, 0.8) for a,b in zip(A,B)]\n    return c\n\n###############################################################################\n# Bandpass filters\n# ----------------\n# First, we display each wavelet according to its scale and orientation.\nfig, axs = plt.subplots(J, L, sharex=True, sharey=True)\nfig.set_figheight(6)\nfig.set_figwidth(6)\nplt.rc('text', usetex=True)\nplt.rc('font', family='serif')\ni=0\nfor filter in filters_set['psi']:\n    f_r = filter[0][...,0].numpy()\n    f_i = filter[0][..., 1].numpy()\n    f = f_r + 1j*f_i\n    filter_c = fft2(f)\n    filter_c = np.fft.fftshift(filter_c)\n    axs[i // L, i % L].imshow(colorize(filter_c))\n    axs[i // L, i % L].axis('off')\n    axs[i // L, i % L].set_title(\"$j = {}$ \\n $\\\\theta={}$\".format(i // L, i % L))\n    i = i+1\n\nfig.suptitle(\"Wavelets for each scales $j$ and angles $\\\\theta$ used.\"\n\"\\n Color saturation and color hue respectively denote complex magnitude and complex phase.\", fontsize=13)\nfig.show()\n\n###############################################################################\n# Lowpass filter\n# --------------\n# We finally display the low-pass filter.\nplt.figure()\nplt.rc('text', usetex=True)\nplt.rc('font', family='serif')\nplt.axis('off')\nplt.set_cmap('gray_r')\n\nf_r = filters_set['phi'][0][..., 0].numpy()\nf_i = filters_set['phi'][0][..., 1].numpy()\nf = f_r + 1j*f_i\n\nfilter_c = fft2(f)\nfilter_c = np.fft.fftshift(filter_c)\nplt.suptitle(\"The corresponding low-pass filter, also known as scaling function.\"\n\"Color saturation and color hue respectively denote complex magnitude and complex phase\", fontsize=13)\nfilter_c = np.abs(filter_c)\nplt.imshow(filter_c)\n", "path": "examples/2d/plot_filters.py"}]}