<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">The figure is copying the image background of the window when I set the facecolor to None.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

import matplotlib
matplotlib.use('Qt5Agg') # Make sure that we are using QT5
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import matplotlib.pyplot as plt

import RessourcesGUI_rc # or any image

class SecondWindow(QWidget):
    def __init__(self, parent=None):
        super(SecondWindow, self).__init__(parent)
        self.setupUi(self)

    def setupUi(self, Form):
        # WINDOW SETTINGS
        Form.setObjectName(&quot;Form&quot;)
        Form.resize(800, 600)
        Form.setWindowTitle('Hello')

        self.p = QPalette()
        self.pixmap = QPixmap(&quot;:/Image_accueil/Fond_fumee_blanche.png&quot;).scaled(self.size(), Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
        self.p.setBrush(QPalette.Background, QBrush(self.pixmap))
        self.setPalette(self.p)

        # CREATE FIGURE AND SETTINGS
        self.figure = plt.figure()
        self.figure.patch.set_facecolor('None')
        self.figure.patch.set_alpha(0)
        self.figure.set_facecolor('None')
        self.figure.set_alpha(0)
        self.canvas = FigureCanvas(self.figure)
        self.axes = self.figure.add_subplot(111)

        self.toolbar = NavigationToolbar(self.canvas, self)
        self.toolbar.hide()

        # NOT IMPORTANT BELOW
        # LAYOUT V1
        self.check1 = QCheckBox('Check 1')
        self.check2 = QCheckBox('check 2')
        self.button1 = QPushButton('Button 1')
        self.button2 = QPushButton('Button 2')
        self.spacerItem1 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
        self.spacerItem2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
        self.spacerItem3 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)

        self.layoutV = QVBoxLayout()
        self.layoutV.setContentsMargins(5, 0, 5, 0)
        self.widget_layoutV = QWidget()
        self.layoutV.addItem(self.spacerItem1)
        self.layoutV.addWidget(self.check1)
        self.layoutV.addWidget(self.check2)
        self.layoutV.addItem(self.spacerItem2)
        self.layoutV.addWidget(self.button1)
        self.layoutV.addWidget(self.button2)
        self.layoutV.addItem(self.spacerItem3)
        self.widget_layoutV.setLayout(self.layoutV)

        # LAYOUT V2
        self.bouton_zoom = QPushButton('Zoom')
        self.bouton_pan = QPushButton('Pan')
        self.bouton_retour = QPushButton('Home')
        self.bouton_curseur = QPushButton('Cursor')

        self.coord_X = QLabel('X : ')
        self.coord_Y = QLabel('Y : ')

        self.layoutV2 = QVBoxLayout()
        self.layoutV2.setContentsMargins(5, 0, 5, 0)
        self.widget_layoutV2 = QWidget()
        self.layoutV2.addWidget(self.coord_X)
        self.layoutV2.addWidget(self.coord_Y)
        self.widget_layoutV2.setLayout(self.layoutV2)

        # LAYOUT H1 (with V2)
        self.layoutH = QHBoxLayout()
        self.layoutH.setContentsMargins(5, 0, 5, 0)
        self.widget_layoutH = QWidget()
        self.layoutH.addWidget(self.bouton_zoom)
        self.layoutH.addWidget(self.bouton_pan)
        self.layoutH.addWidget(self.bouton_retour)
        self.layoutH.addWidget(self.bouton_curseur)
        self.layoutH.addWidget(self.widget_layoutV2)
        self.widget_layoutH.setLayout(self.layoutH)

        # LAYOUT H2 (with V and H2)
        self.layoutH2 = QHBoxLayout()
        self.layoutH2.setContentsMargins(5, 0, 5, 0)
        self.widget_layoutH2 = QWidget()
        self.layoutH2.addWidget(self.canvas,5)
        self.layoutH2.addWidget(self.widget_layoutV)
        self.widget_layoutH2.setLayout(self.layoutH2)

        # WINDOW LAYOUT (with H1 and H2)
        self.setLayout(QVBoxLayout())
        self.layout().addWidget(self.widget_layoutH,1)
        self.layout().addWidget(self.widget_layoutH2,10)
        self.layout().setContentsMargins(5, 0, 5, 0)

    def resizeEvent(self, ResizeEvent):
        size = self.size()
        self.p.setBrush(QPalette.Background, QBrush(self.pixmap.scaled(size, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)))
        self.setPalette(self.p)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    form = SecondWindow()
    form.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">PyQt5</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">PyQt5</span>.<span class="pl-v">QtGui</span> <span class="pl-k">import</span> <span class="pl-c1">*</span>
<span class="pl-k">from</span> <span class="pl-v">PyQt5</span>.<span class="pl-v">QtWidgets</span> <span class="pl-k">import</span> <span class="pl-c1">*</span>

<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-s1">matplotlib</span>.<span class="pl-en">use</span>(<span class="pl-s">'Qt5Agg'</span>) <span class="pl-c"># Make sure that we are using QT5</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">as</span> <span class="pl-v">FigureCanvas</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">NavigationToolbar2QT</span> <span class="pl-k">as</span> <span class="pl-v">NavigationToolbar</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">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>

<span class="pl-k">import</span> <span class="pl-v">RessourcesGUI_rc</span> <span class="pl-c"># or any image</span>

<span class="pl-k">class</span> <span class="pl-v">SecondWindow</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-s1">parent</span><span class="pl-c1">=</span><span class="pl-c1">None</span>):
        <span class="pl-en">super</span>(<span class="pl-v">SecondWindow</span>, <span class="pl-s1">self</span>).<span class="pl-en">__init__</span>(<span class="pl-s1">parent</span>)
        <span class="pl-s1">self</span>.<span class="pl-en">setupUi</span>(<span class="pl-s1">self</span>)

    <span class="pl-k">def</span> <span class="pl-en">setupUi</span>(<span class="pl-s1">self</span>, <span class="pl-v">Form</span>):
        <span class="pl-c"># WINDOW SETTINGS</span>
        <span class="pl-v">Form</span>.<span class="pl-en">setObjectName</span>(<span class="pl-s">"Form"</span>)
        <span class="pl-v">Form</span>.<span class="pl-en">resize</span>(<span class="pl-c1">800</span>, <span class="pl-c1">600</span>)
        <span class="pl-v">Form</span>.<span class="pl-en">setWindowTitle</span>(<span class="pl-s">'Hello'</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">p</span> <span class="pl-c1">=</span> <span class="pl-v">QPalette</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">pixmap</span> <span class="pl-c1">=</span> <span class="pl-v">QPixmap</span>(<span class="pl-s">":/Image_accueil/Fond_fumee_blanche.png"</span>).<span class="pl-en">scaled</span>(<span class="pl-s1">self</span>.<span class="pl-en">size</span>(), <span class="pl-v">Qt</span>.<span class="pl-v">IgnoreAspectRatio</span>, <span class="pl-v">Qt</span>.<span class="pl-v">SmoothTransformation</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">p</span>.<span class="pl-en">setBrush</span>(<span class="pl-v">QPalette</span>.<span class="pl-v">Background</span>, <span class="pl-v">QBrush</span>(<span class="pl-s1">self</span>.<span class="pl-s1">pixmap</span>))
        <span class="pl-s1">self</span>.<span class="pl-en">setPalette</span>(<span class="pl-s1">self</span>.<span class="pl-s1">p</span>)

        <span class="pl-c"># CREATE FIGURE AND SETTINGS</span>
        <span class="pl-s1">self</span>.<span class="pl-s1">figure</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">figure</span>.<span class="pl-s1">patch</span>.<span class="pl-en">set_facecolor</span>(<span class="pl-s">'None'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">figure</span>.<span class="pl-s1">patch</span>.<span class="pl-en">set_alpha</span>(<span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">figure</span>.<span class="pl-en">set_facecolor</span>(<span class="pl-s">'None'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">figure</span>.<span class="pl-en">set_alpha</span>(<span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">canvas</span> <span class="pl-c1">=</span> <span class="pl-v">FigureCanvas</span>(<span class="pl-s1">self</span>.<span class="pl-s1">figure</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">figure</span>.<span class="pl-en">add_subplot</span>(<span class="pl-c1">111</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">toolbar</span> <span class="pl-c1">=</span> <span class="pl-v">NavigationToolbar</span>(<span class="pl-s1">self</span>.<span class="pl-s1">canvas</span>, <span class="pl-s1">self</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">toolbar</span>.<span class="pl-en">hide</span>()

        <span class="pl-c"># NOT IMPORTANT BELOW</span>
        <span class="pl-c"># LAYOUT V1</span>
        <span class="pl-s1">self</span>.<span class="pl-s1">check1</span> <span class="pl-c1">=</span> <span class="pl-v">QCheckBox</span>(<span class="pl-s">'Check 1'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">check2</span> <span class="pl-c1">=</span> <span class="pl-v">QCheckBox</span>(<span class="pl-s">'check 2'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">button1</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Button 1'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">button2</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Button 2'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">spacerItem1</span> <span class="pl-c1">=</span> <span class="pl-v">QSpacerItem</span>(<span class="pl-c1">20</span>, <span class="pl-c1">40</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Minimum</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Expanding</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">spacerItem2</span> <span class="pl-c1">=</span> <span class="pl-v">QSpacerItem</span>(<span class="pl-c1">20</span>, <span class="pl-c1">40</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Minimum</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Expanding</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">spacerItem3</span> <span class="pl-c1">=</span> <span class="pl-v">QSpacerItem</span>(<span class="pl-c1">20</span>, <span class="pl-c1">40</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Minimum</span>, <span class="pl-v">QSizePolicy</span>.<span class="pl-v">Expanding</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span> <span class="pl-c1">=</span> <span class="pl-v">QVBoxLayout</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">setContentsMargins</span>(<span class="pl-c1">5</span>, <span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV</span> <span class="pl-c1">=</span> <span class="pl-v">QWidget</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addItem</span>(<span class="pl-s1">self</span>.<span class="pl-s1">spacerItem1</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">check1</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">check2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addItem</span>(<span class="pl-s1">self</span>.<span class="pl-s1">spacerItem2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">button1</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">button2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>.<span class="pl-en">addItem</span>(<span class="pl-s1">self</span>.<span class="pl-s1">spacerItem3</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV</span>.<span class="pl-en">setLayout</span>(<span class="pl-s1">self</span>.<span class="pl-s1">layoutV</span>)

        <span class="pl-c"># LAYOUT V2</span>
        <span class="pl-s1">self</span>.<span class="pl-s1">bouton_zoom</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Zoom'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">bouton_pan</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Pan'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">bouton_retour</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Home'</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">bouton_curseur</span> <span class="pl-c1">=</span> <span class="pl-v">QPushButton</span>(<span class="pl-s">'Cursor'</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">coord_X</span> <span class="pl-c1">=</span> <span class="pl-v">QLabel</span>(<span class="pl-s">'X : '</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">coord_Y</span> <span class="pl-c1">=</span> <span class="pl-v">QLabel</span>(<span class="pl-s">'Y : '</span>)

        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV2</span> <span class="pl-c1">=</span> <span class="pl-v">QVBoxLayout</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV2</span>.<span class="pl-en">setContentsMargins</span>(<span class="pl-c1">5</span>, <span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV2</span> <span class="pl-c1">=</span> <span class="pl-v">QWidget</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV2</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">coord_X</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutV2</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">coord_Y</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV2</span>.<span class="pl-en">setLayout</span>(<span class="pl-s1">self</span>.<span class="pl-s1">layoutV2</span>)

        <span class="pl-c"># LAYOUT H1 (with V2)</span>
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span> <span class="pl-c1">=</span> <span class="pl-v">QHBoxLayout</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">setContentsMargins</span>(<span class="pl-c1">5</span>, <span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH</span> <span class="pl-c1">=</span> <span class="pl-v">QWidget</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">bouton_zoom</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">bouton_pan</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">bouton_retour</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">bouton_curseur</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV2</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH</span>.<span class="pl-en">setLayout</span>(<span class="pl-s1">self</span>.<span class="pl-s1">layoutH</span>)

        <span class="pl-c"># LAYOUT H2 (with V and H2)</span>
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH2</span> <span class="pl-c1">=</span> <span class="pl-v">QHBoxLayout</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH2</span>.<span class="pl-en">setContentsMargins</span>(<span class="pl-c1">5</span>, <span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">0</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH2</span> <span class="pl-c1">=</span> <span class="pl-v">QWidget</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH2</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">canvas</span>,<span class="pl-c1">5</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">layoutH2</span>.<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutV</span>)
        <span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH2</span>.<span class="pl-en">setLayout</span>(<span class="pl-s1">self</span>.<span class="pl-s1">layoutH2</span>)

        <span class="pl-c"># WINDOW LAYOUT (with H1 and H2)</span>
        <span class="pl-s1">self</span>.<span class="pl-en">setLayout</span>(<span class="pl-v">QVBoxLayout</span>())
        <span class="pl-s1">self</span>.<span class="pl-en">layout</span>().<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH</span>,<span class="pl-c1">1</span>)
        <span class="pl-s1">self</span>.<span class="pl-en">layout</span>().<span class="pl-en">addWidget</span>(<span class="pl-s1">self</span>.<span class="pl-s1">widget_layoutH2</span>,<span class="pl-c1">10</span>)
        <span class="pl-s1">self</span>.<span class="pl-en">layout</span>().<span class="pl-en">setContentsMargins</span>(<span class="pl-c1">5</span>, <span class="pl-c1">0</span>, <span class="pl-c1">5</span>, <span class="pl-c1">0</span>)

    <span class="pl-k">def</span> <span class="pl-en">resizeEvent</span>(<span class="pl-s1">self</span>, <span class="pl-v">ResizeEvent</span>):
        <span class="pl-s1">size</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">size</span>()
        <span class="pl-s1">self</span>.<span class="pl-s1">p</span>.<span class="pl-en">setBrush</span>(<span class="pl-v">QPalette</span>.<span class="pl-v">Background</span>, <span class="pl-v">QBrush</span>(<span class="pl-s1">self</span>.<span class="pl-s1">pixmap</span>.<span class="pl-en">scaled</span>(<span class="pl-s1">size</span>, <span class="pl-v">Qt</span>.<span class="pl-v">IgnoreAspectRatio</span>, <span class="pl-v">Qt</span>.<span class="pl-v">SmoothTransformation</span>)))
        <span class="pl-s1">self</span>.<span class="pl-en">setPalette</span>(<span class="pl-s1">self</span>.<span class="pl-s1">p</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">form</span> <span class="pl-c1">=</span> <span class="pl-v">SecondWindow</span>()
    <span class="pl-s1">form</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>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30922706/29204715-e9445916-7e78-11e7-875d-48ef3e4f37a1.png"><img src="https://user-images.githubusercontent.com/30922706/29204715-e9445916-7e78-11e7-875d-48ef3e4f37a1.png" alt="actual_outcome" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">I wish to have a real transprent background for the figure. Like this, the background of the window will not be duplicated into the figure.</p>
<p dir="auto">Thanks for your help !</p>
<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating System: Windows 7 Pro</li>
<li>Matplotlib Version: 2.0.2 (installed via Anaconda, conda install matplotlib --channel conda-forge)</li>
<li>Python Version: Python 3.6</li>
</ul>
<p dir="auto">Bug also reported here: <a href="https://bugs.archlinux.org/task/41790" rel="nofollow">https://bugs.archlinux.org/task/41790</a><br>
When clicking on the Save button on the NavigationToolbar, I get an error:<br>
<code class="notranslate">Format "png)')" is not supported. Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.</code></p>
<p dir="auto">I tracked the bug to be coming from the output of the <code class="notranslate">_getSaveFileName</code> function, that is supposed to be a string but is a tuple in reality. In <code class="notranslate">qt_compat.py</code>, <code class="notranslate">_getSaveFileName</code> links to QtWidgets.QtFileDialog.getSaveFileName.<br>
In pyqt4, this function returns a string, but the doc pyqt4/5 differences says that in pyqt5 the functions returns a tuple (filename, extension), as for <code class="notranslate">getSaveFileNameAndFilter</code> in pyqt4.</p>
<p dir="auto">Commenting line 96 in <code class="notranslate">qt_compat.py</code>  solved the problem, because <code class="notranslate">_getSaveFileName</code> is then correctly defined in line 117 (only returning the first element of the tuple).</p>