Issue 1:
Bug report

Bug summary

The figure is copying the image background of the window when I set the facecolor to None.

Code for reproduction

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("Form")
Form.resize(800, 600)
Form.setWindowTitle('Hello')

self.p = QPalette()
self.pixmap = QPixmap(":/Image_accueil/Fond_fumee_blanche.png").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_())

Actual outcome

Expected outcome

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.

Thanks for your help !

Matplotlib version

Operating System: Windows 7 Pro

Matplotlib Version: 2.0.2 (installed via Anaconda, conda install matplotlib --channel conda-forge)

Python Version: Python 3.6

Issue 2:
Bug also reported here: https://bugs.archlinux.org/task/41790

When clicking on the Save button on the NavigationToolbar, I get an error:

Format "png)')" is not supported. Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.

I tracked the bug to be coming from the output of the _getSaveFileName function, that is supposed to be a string but is a tuple in reality. In qt_compat.py, _getSaveFileName links to QtWidgets.QtFileDialog.getSaveFileName.

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 getSaveFileNameAndFilter in pyqt4.

Commenting line 96 in qt_compat.py solved the problem, because _getSaveFileName is then correctly defined in line 117 (only returning the first element of the tuple).