<h3 dir="auto">Bug summary</h3>
<p dir="auto"><code class="notranslate">FigureCanvasQTAgg.__init__(self, mpl_fig.Figure())</code> gives <code class="notranslate">TypeError: FuncAnimation.__init__() missing 2 required positional arguments: 'fig' and 'func'</code>. Was working in matplotlib 3.5.2. Same Problem appears by using FigureCanvas.</p>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.figure as mpl_fig
import matplotlib.animation as anim
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg

class SimulationPrevCanvas(FigureCanvasQTAgg, anim.FuncAnimation):
    def __init__(self, x:List, y:List) -&gt; None:
        FigureCanvasQTAgg.__init__(self, mpl_fig.Figure())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">figure</span> <span class="pl-k">as</span> <span class="pl-s1">mpl_fig</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">animation</span> <span class="pl-k">as</span> <span class="pl-s1">anim</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">backends</span>.<span class="pl-s1">backend_qt5agg</span> <span class="pl-k">import</span> <span class="pl-v">FigureCanvasQTAgg</span>

<span class="pl-k">class</span> <span class="pl-v">SimulationPrevCanvas</span>(<span class="pl-v">FigureCanvasQTAgg</span>, <span class="pl-s1">anim</span>.<span class="pl-v">FuncAnimation</span>):
    <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">x</span>:<span class="pl-v">List</span>, <span class="pl-s1">y</span>:<span class="pl-v">List</span>) <span class="pl-c1">-&gt;</span> <span class="pl-c1">None</span>:
        <span class="pl-v">FigureCanvasQTAgg</span>.<span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">mpl_fig</span>.<span class="pl-v">Figure</span>())</pre></div>
<h3 dir="auto">Actual outcome</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    super().__init__()  # Typically the GUI widget init (if any).
TypeError: FuncAnimation.__init__() missing 2 required positional arguments: 'fig' and 'func'"><pre class="notranslate"><code class="notranslate">    super().__init__()  # Typically the GUI widget init (if any).
TypeError: FuncAnimation.__init__() missing 2 required positional arguments: 'fig' and 'func'
</code></pre></div>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">Animated plot inside QT.</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.7</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Python version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">conda</p>
<h3 dir="auto">Bug summary</h3>
<p dir="auto">Hi 👋🏼<br>
When using the recently released PySide 6.5.0 with matplotlib 3.7.1 and python 3.10, an error is raised at FuncAnimation initialization that doesn't happen with the same code on previous PySide versions.</p>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sys

from PySide6.QtCore import Qt
from PySide6.QtWidgets import (QApplication, QLabel, QVBoxLayout, QWidget)
from matplotlib.artist import Artist
from matplotlib.animation import FuncAnimation
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
from matplotlib.figure import Figure
import numpy as np


class MplCanvas(FigureCanvasQTAgg, FuncAnimation):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        self.fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = self.fig.add_subplot(111)
        self.axes.set_xlim(0, 2)
        self.axes.set_ylim(-2, 2)
        self.line,  = self.axes.plot([], [], lw=2)
        self.line.set_data([], [])
        FigureCanvasQTAgg.__init__(self, self.fig)
        FuncAnimation.__init__(
            self, 
            self.fig, 
            func=self.draw_frame, 
            frames=200,
            interval=20, 
            blit=True, 
            cache_frame_data=False
        )

    def draw_frame(self, frame: int) -&gt; list[Artist]:
        x = np.linspace(0, 5, 1000)
        y = np.sin(2 * np.pi * (x - 0.01 * frame))
        self.line.set_data(x, y)
        return [self.line]


class MyWidget(QWidget):
    def __init__(self):
        QWidget.__init__(self)

        self.text = QLabel(&quot;Hello World&quot;)
        self.text.setAlignment(Qt.AlignCenter)

        sc = MplCanvas(self, width=5, height=4, dpi=100)

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.text)
        self.layout.addWidget(sc)
        self.setLayout(self.layout)


if __name__ == &quot;__main__&quot;:
    app = QApplication(sys.argv)

    widget = MyWidget()
    widget.resize(800, 600)
    widget.show()

    sys.exit(app.exec())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">sys</span>

<span class="pl-k">from</span> <span class="pl-v">PySide6</span>.<span class="pl-v">QtCore</span> <span class="pl-k">import</span> <span class="pl-v">Qt</span>
<span class="pl-k">from</span> <span class="pl-v">PySide6</span>.<span class="pl-v">QtWidgets</span> <span class="pl-k">import</span> (<span class="pl-v">QApplication</span>, <span class="pl-v">QLabel</span>, <span class="pl-v">QVBoxLayout</span>, <span class="pl-v">QWidget</span>)
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">artist</span> <span class="pl-k">import</span> <span class="pl-v">Artist</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">animation</span> <span class="pl-k">import</span> <span class="pl-v">FuncAnimation</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">backends</span>.<span class="pl-s1">backend_qtagg</span> <span class="pl-k">import</span> <span class="pl-v">FigureCanvasQTAgg</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">figure</span> <span class="pl-k">import</span> <span class="pl-v">Figure</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>


<span class="pl-k">class</span> <span class="pl-v">MplCanvas</span>(<span class="pl-v">FigureCanvasQTAgg</span>, <span class="pl-v">FuncAnimation</span>):

    <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">parent</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">width</span><span class="pl-c1">=</span><span class="pl-c1">5</span>, <span class="pl-s1">height</span><span class="pl-c1">=</span><span class="pl-c1">4</span>, <span class="pl-s1">dpi</span><span class="pl-c1">=</span><span class="pl-c1">100</span>):
        <span class="pl-s1">self</span>.<span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-v">Figure</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-s1">width</span>, <span class="pl-s1">height</span>), <span class="pl-s1">dpi</span><span class="pl-c1">=</span><span class="pl-s1">dpi</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">axes</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">fig</span>.<span class="pl-en">add_subplot</span>(<span class="pl-c1">111</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">axes</span>.<span class="pl-en">set_xlim</span>(<span class="pl-c1">0</span>, <span class="pl-c1">2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">axes</span>.<span class="pl-en">set_ylim</span>(<span class="pl-c1">-</span><span class="pl-c1">2</span>, <span class="pl-c1">2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">line</span>,  <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">axes</span>.<span class="pl-en">plot</span>([], [], <span class="pl-s1">lw</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">line</span>.<span class="pl-en">set_data</span>([], [])
        <span class="pl-v">FigureCanvasQTAgg</span>.<span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">self</span>.<span class="pl-s1">fig</span>)
        <span class="pl-v">FuncAnimation</span>.<span class="pl-en">__init__</span>(
            <span class="pl-s1">self</span>, 
            <span class="pl-s1">self</span>.<span class="pl-s1">fig</span>, 
            <span class="pl-s1">func</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">draw_frame</span>, 
            <span class="pl-s1">frames</span><span class="pl-c1">=</span><span class="pl-c1">200</span>,
            <span class="pl-s1">interval</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, 
            <span class="pl-s1">blit</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, 
            <span class="pl-s1">cache_frame_data</span><span class="pl-c1">=</span><span class="pl-c1">False</span>
        )

    <span class="pl-k">def</span> <span class="pl-en">draw_frame</span>(<span class="pl-s1">self</span>, <span class="pl-s1">frame</span>: <span class="pl-s1">int</span>) <span class="pl-c1">-&gt;</span> <span class="pl-s1">list</span>[<span class="pl-v">Artist</span>]:
        <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">1000</span>)
        <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">sin</span>(<span class="pl-c1">2</span> <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-s1">pi</span> <span class="pl-c1">*</span> (<span class="pl-s1">x</span> <span class="pl-c1">-</span> <span class="pl-c1">0.01</span> <span class="pl-c1">*</span> <span class="pl-s1">frame</span>))
        <span class="pl-s1">self</span>.<span class="pl-s1">line</span>.<span class="pl-en">set_data</span>(<span class="pl-s1">x</span>, <span class="pl-s1">y</span>)
        <span class="pl-k">return</span> [<span class="pl-s1">self</span>.<span class="pl-s1">line</span>]


<span class="pl-k">class</span> <span class="pl-v">MyWidget</span>(<span class="pl-v">QWidget</span>):
    <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>):
        <span class="pl-v">QWidget</span>.<span class="pl-en">__init__</span>(<span class="pl-s1">self</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">text</span> <span class="pl-c1">=</span> <span class="pl-v">QLabel</span>(<span class="pl-s">"Hello World"</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">text</span>.<span class="pl-en">setAlignment</span>(<span class="pl-v">Qt</span>.<span class="pl-v">AlignCenter</span>)

        <span class="pl-s1">sc</span> <span class="pl-c1">=</span> <span class="pl-v">MplCanvas</span>(<span class="pl-s1">self</span>, <span class="pl-s1">width</span><span class="pl-c1">=</span><span class="pl-c1">5</span>, <span class="pl-s1">height</span><span class="pl-c1">=</span><span class="pl-c1">4</span>, <span class="pl-s1">dpi</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">layout</span> <span class="pl-c1">=</span> <span class="pl-v">QVBoxLayout</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layout</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">text</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layout</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">sc</span>)
        <span class="pl-s1">self</span>.<span class="pl-en">setLayout</span>(<span class="pl-s1">self</span>.<span class="pl-s1">layout</span>)


<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
    <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">QApplication</span>(<span class="pl-s1">sys</span>.<span class="pl-s1">argv</span>)

    <span class="pl-s1">widget</span> <span class="pl-c1">=</span> <span class="pl-v">MyWidget</span>()
    <span class="pl-s1">widget</span>.<span class="pl-en">resize</span>(<span class="pl-c1">800</span>, <span class="pl-c1">600</span>)
    <span class="pl-s1">widget</span>.<span class="pl-en">show</span>()

    <span class="pl-s1">sys</span>.<span class="pl-en">exit</span>(<span class="pl-s1">app</span>.<span class="pl-en">exec</span>())</pre></div>
<h3 dir="auto">Actual outcome</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/home/theguy/projects/test_matplotlib/plot.py&quot;, line 59, in &lt;module&gt;
    widget = MyWidget()
  File &quot;/home/theguy/projects/test_matplotlib/plot.py&quot;, line 46, in __init__
    sc = MplCanvas(self, width=5, height=4, dpi=100)
  File &quot;/home/theguy/projects/test_matplotlib/plot.py&quot;, line 21, in __init__
    FigureCanvasQTAgg.__init__(self, self.fig)
  File &quot;/home/theguy/.cache/pypoetry/virtualenvs/test-matplotlib-WtQHVv9a-py3.10/lib64/python3.10/site-packages/matplotlib/backends/backend_qt.py&quot;, line 205, in __init__
    super().__init__(figure=figure)
  File &quot;/home/theguy/.cache/pypoetry/virtualenvs/test-matplotlib-WtQHVv9a-py3.10/lib64/python3.10/site-packages/matplotlib/backend_bases.py&quot;, line 1695, in __init__
    super().__init__()  # Typically the GUI widget init (if any).
TypeError: FuncAnimation.__init__() missing 2 required positional arguments: 'fig' and 'func'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/home/theguy/projects/test_matplotlib/plot.py", line 59, in &lt;module&gt;
    widget = MyWidget()
  File "/home/theguy/projects/test_matplotlib/plot.py", line 46, in __init__
    sc = MplCanvas(self, width=5, height=4, dpi=100)
  File "/home/theguy/projects/test_matplotlib/plot.py", line 21, in __init__
    FigureCanvasQTAgg.__init__(self, self.fig)
  File "/home/theguy/.cache/pypoetry/virtualenvs/test-matplotlib-WtQHVv9a-py3.10/lib64/python3.10/site-packages/matplotlib/backends/backend_qt.py", line 205, in __init__
    super().__init__(figure=figure)
  File "/home/theguy/.cache/pypoetry/virtualenvs/test-matplotlib-WtQHVv9a-py3.10/lib64/python3.10/site-packages/matplotlib/backend_bases.py", line 1695, in __init__
    super().__init__()  # Typically the GUI widget init (if any).
TypeError: FuncAnimation.__init__() missing 2 required positional arguments: 'fig' and 'func'
</code></pre></div>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">A window opens and renders a simple sine wave animation.</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto">If I remove the FuncAnimation then the window opens and I can draw some static lines without issue.</p>
<p dir="auto">No error is raised when using pyside6_essentials &lt;=6.4.3</p>
<p dir="auto">I've looked around the source code and tried a few things out to no avail.</p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Arch, Fedora</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.7.1</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">QtAgg</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">Python 3.10.10</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">pip</p>