Description
OS: Archlinux
Python: 2.7.8
PyQt bindings: 5.3.2-1
Qt: 5.3.2-1
Matplotlib: 1.4.0-2
Steps to reproduce:
from matplotlib import pyplot as plt
y_data = [....]
plt.plot(y_data, 'k+')
plt.show()
then press the "Save the figure" icon, it shows the dialog to write a filename. Then press Save, a model error window will pop-up complaining that "png)')" is not a supporte file extension.
Digging further in matplotlib/backend_bases.py (~2098) tries to resolve the extension by
if cbook.is_string_like(filename):
format = os.path.splitext(filename)[1][1:]
but filename is this unicode:
u"(u'/home/rbm/figure_1.png', u'Portable Network Graphics (*.png)')"
This in turn comes from the qt5 backend filters passed in method save_fig of matplotlib/backends/backend_qt5.py :
Encapsulated Postscript (.eps);;Joint Photographic Experts Group (.jpeg .jpg);;PGF code for LaTeX (.pgf);;Portable Document Format (.pdf);;Portable Network Graphics (.png);;Postscript (.ps);;Raw RGBA bitmap (.raw .rgba);;Scalable Vector Graphics (.svg .svgz);;Tagged Image File Format (.tif *.tiff)
This will fail for every other format whatever choosed in the Save File dialog.
I tested the GTK backend and it doesn't have this problem.