diff --git a/doc/_static/toolbar.png b/doc/_static/toolbar.png
index b63976bb3b2d..024ed625d2ca 100644
Binary files a/doc/_static/toolbar.png and b/doc/_static/toolbar.png differ
diff --git a/doc/users/navigation_toolbar.rst b/doc/users/navigation_toolbar.rst
index 8902873b9492..caa2387e0089 100644
--- a/doc/users/navigation_toolbar.rst
+++ b/doc/users/navigation_toolbar.rst
@@ -9,11 +9,11 @@ All figure windows come with a navigation toolbar, which can be used
to navigate through the data set. Here is a description of each of
the buttons at the bottom of the toolbar
-.. image:: ../../lib/matplotlib/mpl-data/images/home.png
+.. image:: ../../lib/matplotlib/mpl-data/images/home_large.png
-.. image:: ../../lib/matplotlib/mpl-data/images/back.png
+.. image:: ../../lib/matplotlib/mpl-data/images/back_large.png
-.. image:: ../../lib/matplotlib/mpl-data/images/forward.png
+.. image:: ../../lib/matplotlib/mpl-data/images/forward_large.png
The ``Home``, ``Forward`` and ``Back`` buttons
These are akin to a web browser's home, forward and back controls.
@@ -26,7 +26,7 @@ The ``Home``, ``Forward`` and ``Back`` buttons
first, default view of your data. Again, all of these buttons should
feel very familiar to any user of a web browser.
-.. image:: ../../lib/matplotlib/mpl-data/images/move.png
+.. image:: ../../lib/matplotlib/mpl-data/images/move_large.png
The ``Pan/Zoom`` button
This button has two modes: pan and zoom. Click the toolbar button
@@ -50,7 +50,7 @@ The ``Pan/Zoom`` button
mouse button. The radius scale can be zoomed in and out using the
right mouse button.
-.. image:: ../../lib/matplotlib/mpl-data/images/zoom_to_rect.png
+.. image:: ../../lib/matplotlib/mpl-data/images/zoom_to_rect_large.png
The ``Zoom-to-rectangle`` button
Click this toolbar button to activate this mode. Put your mouse
@@ -61,15 +61,15 @@ The ``Zoom-to-rectangle`` button
with the right button, which will place your entire axes in the
region defined by the zoom out rectangle.
-.. image:: ../../lib/matplotlib/mpl-data/images/subplots.png
+.. image:: ../../lib/matplotlib/mpl-data/images/subplots_large.png
The ``Subplot-configuration`` button
Use this tool to configure the appearance of the subplot:
you can stretch or compress the left, right, top, or bottom
- side of the subplot, or the space between the rows or
+ side of the subplot, or the space between the rows or
space between the columns.
-.. image:: ../../lib/matplotlib/mpl-data/images/filesave.png
+.. image:: ../../lib/matplotlib/mpl-data/images/filesave_large.png
The ``Save`` button
Click this button to launch a file save dialog. You can save
@@ -137,8 +137,3 @@ example code for GTK::
win.show_all()
gtk.main()
-
-
-
-
-
diff --git a/examples/pylab_examples/matplotlib_icon.py b/examples/pylab_examples/matplotlib_icon.py
deleted file mode 100644
index 50c70eedc2d5..000000000000
--- a/examples/pylab_examples/matplotlib_icon.py
+++ /dev/null
@@ -1,21 +0,0 @@
-"""
-make the matplotlib svg minimization icon
-"""
-import matplotlib.pyplot as plt
-import matplotlib
-import numpy as np
-
-matplotlib.rc('grid', ls='-', lw=2, color='k')
-fig = plt.figure(figsize=(1, 1), dpi=72)
-plt.axes([0.025, 0.025, 0.95, 0.95], facecolor='#bfd1d4')
-
-t = np.arange(0, 2, 0.05)
-s = np.sin(2*np.pi*t)
-plt.plot(t, s, linewidth=4, color="#ca7900")
-plt.axis([-.2, 2.2, -1.2, 1.2])
-
-ax = plt.gca()
-ax.set_xticklabels([])
-ax.set_yticklabels([])
-
-plt.show()
diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py
index 277a06b47a1b..cce7d1827160 100644
--- a/lib/matplotlib/backend_bases.py
+++ b/lib/matplotlib/backend_bases.py
@@ -2733,8 +2733,8 @@ class NavigationToolbar2(object):
(None, None, None, None),
('Pan', 'Pan axes with left mouse, zoom with right', 'move', 'pan'),
('Zoom', 'Zoom to rectangle', 'zoom_to_rect', 'zoom'),
- (None, None, None, None),
('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'),
+ (None, None, None, None),
('Save', 'Save the figure', 'filesave', 'save_figure'),
)
diff --git a/lib/matplotlib/backend_tools.py b/lib/matplotlib/backend_tools.py
index f57664883520..b86c966142af 100644
--- a/lib/matplotlib/backend_tools.py
+++ b/lib/matplotlib/backend_tools.py
@@ -924,8 +924,7 @@ def _mouse_move(self, event):
"""Default tools"""
default_toolbar_tools = [['navigation', ['home', 'back', 'forward']],
- ['zoompan', ['pan', 'zoom']],
- ['layout', ['subplots']],
+ ['zoompan', ['pan', 'zoom', 'subplots']],
['io', ['save']]]
"""Default tools in the toolbar"""
diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py
index 8be5e263fb29..3c39d18a68ef 100644
--- a/lib/matplotlib/backends/backend_qt5.py
+++ b/lib/matplotlib/backends/backend_qt5.py
@@ -28,7 +28,8 @@
except ImportError:
figureoptions = None
-from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, __version__
+from .qt_compat import (QtCore, QtGui, QtWidgets, _getSaveFileName,
+ __version__, is_pyqt5)
from matplotlib.backends.qt_editor.formsubplottool import UiSubplotTool
backend_version = __version__
@@ -142,6 +143,9 @@ def _create_qApp():
else:
qApp = app
+ if is_pyqt5():
+ qApp.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
+
class Show(ShowBase):
def mainloop(self):
@@ -581,6 +585,8 @@ def __init__(self, canvas, parent, coordinates=True):
NavigationToolbar2.__init__(self, canvas)
def _icon(self, name):
+ if is_pyqt5():
+ name = name.replace('.png', '_large.png')
return QtGui.QIcon(os.path.join(self.basedir, name))
def _init_toolbar(self):
@@ -597,11 +603,10 @@ def _init_toolbar(self):
a.setCheckable(True)
if tooltip_text is not None:
a.setToolTip(tooltip_text)
-
- if figureoptions is not None:
- a = self.addAction(self._icon("qt4_editor_options.png"),
- 'Customize', self.edit_parameters)
- a.setToolTip('Edit axis, curve and image parameters')
+ if figureoptions is not None and text == 'Subplots':
+ a = self.addAction(self._icon("qt4_editor_options.png"),
+ 'Customize', self.edit_parameters)
+ a.setToolTip('Edit axis, curve and image parameters')
self.buttons = {}
@@ -621,6 +626,14 @@ def _init_toolbar(self):
# reference holder for subplots_adjust window
self.adj_window = None
+ # Esthetic adjustments - we need to set these explicitly in PyQt5
+ # otherwise the layout looks different - but we don't want to set it if
+ # not using HiDPI icons otherwise they look worse than before.
+ if is_pyqt5():
+ self.setIconSize(QtCore.QSize(24, 24))
+ self.layout().setSpacing(12)
+ self.setMinimumHeight(48)
+
if figureoptions is not None:
def edit_parameters(self):
allaxes = self.canvas.figure.get_axes()
diff --git a/lib/matplotlib/backends/backend_tkagg.py b/lib/matplotlib/backends/backend_tkagg.py
index d57af42ceba5..45dca4be3804 100644
--- a/lib/matplotlib/backends/backend_tkagg.py
+++ b/lib/matplotlib/backends/backend_tkagg.py
@@ -97,7 +97,7 @@ def new_figure_manager_given_figure(num, figure):
# doesn't allow colour icons on linux systems, but tk >=8.5 has a iconphoto
# command which we call directly. Source:
# http://mail.python.org/pipermail/tkinter-discuss/2006-November/000954.html
- icon_fname = os.path.join(rcParams['datapath'], 'images', 'matplotlib.gif')
+ icon_fname = os.path.join(rcParams['datapath'], 'images', 'matplotlib.ppm')
icon_img = Tk.PhotoImage(file=icon_fname)
try:
window.tk.call('wm', 'iconphoto', window._w, icon_img)
diff --git a/lib/matplotlib/backends/qt_compat.py b/lib/matplotlib/backends/qt_compat.py
index 728bd8ab7d0f..ee18036d3d8e 100644
--- a/lib/matplotlib/backends/qt_compat.py
+++ b/lib/matplotlib/backends/qt_compat.py
@@ -204,3 +204,7 @@ def _getSaveFileName(*args, **kwargs):
'''
QtWidgets = QtGui
+
+
+def is_pyqt5():
+ return QT_API == QT_API_PYQT5
diff --git a/lib/matplotlib/mpl-data/images/back.pdf b/lib/matplotlib/mpl-data/images/back.pdf
index e59cc0793d88..79709d8f435e 100644
Binary files a/lib/matplotlib/mpl-data/images/back.pdf and b/lib/matplotlib/mpl-data/images/back.pdf differ
diff --git a/lib/matplotlib/mpl-data/images/back.png b/lib/matplotlib/mpl-data/images/back.png
index c23e1b5570f0..e3c4b5815487 100644
Binary files a/lib/matplotlib/mpl-data/images/back.png and b/lib/matplotlib/mpl-data/images/back.png differ
diff --git a/lib/matplotlib/mpl-data/images/back.ppm b/lib/matplotlib/mpl-data/images/back.ppm
index 7d576e7e6cc1..a476925cde60 100644
Binary files a/lib/matplotlib/mpl-data/images/back.ppm and b/lib/matplotlib/mpl-data/images/back.ppm differ
diff --git a/lib/matplotlib/mpl-data/images/back.svg b/lib/matplotlib/mpl-data/images/back.svg
index 0cb250ab224a..a933ef8cdf50 100755
--- a/lib/matplotlib/mpl-data/images/back.svg
+++ b/lib/matplotlib/mpl-data/images/back.svg
@@ -1,63 +1,46 @@
-
-
-]>
-
-
\ No newline at end of file
+
+
+
+
diff --git a/lib/matplotlib/mpl-data/images/back_large.png b/lib/matplotlib/mpl-data/images/back_large.png
new file mode 100644
index 000000000000..e44a70a9cd23
Binary files /dev/null and b/lib/matplotlib/mpl-data/images/back_large.png differ
diff --git a/lib/matplotlib/mpl-data/images/back_large.ppm b/lib/matplotlib/mpl-data/images/back_large.ppm
new file mode 100644
index 000000000000..e79d3610bd52
Binary files /dev/null and b/lib/matplotlib/mpl-data/images/back_large.ppm differ
diff --git a/lib/matplotlib/mpl-data/images/filesave.pdf b/lib/matplotlib/mpl-data/images/filesave.pdf
index df31f32de46b..794a1152f602 100644
Binary files a/lib/matplotlib/mpl-data/images/filesave.pdf and b/lib/matplotlib/mpl-data/images/filesave.pdf differ
diff --git a/lib/matplotlib/mpl-data/images/filesave.png b/lib/matplotlib/mpl-data/images/filesave.png
index 790182194238..919e40bf5829 100644
Binary files a/lib/matplotlib/mpl-data/images/filesave.png and b/lib/matplotlib/mpl-data/images/filesave.png differ
diff --git a/lib/matplotlib/mpl-data/images/filesave.ppm b/lib/matplotlib/mpl-data/images/filesave.ppm
index f6f3b87ef110..02eb3c84bce0 100644
Binary files a/lib/matplotlib/mpl-data/images/filesave.ppm and b/lib/matplotlib/mpl-data/images/filesave.ppm differ
diff --git a/lib/matplotlib/mpl-data/images/filesave.svg b/lib/matplotlib/mpl-data/images/filesave.svg
index cf09550efe98..ad8372d295de 100755
--- a/lib/matplotlib/mpl-data/images/filesave.svg
+++ b/lib/matplotlib/mpl-data/images/filesave.svg
@@ -1,450 +1,68 @@
-
-
-