From 74dc88f483618482c7bcfe000fe722e5ef14db23 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 28 Mar 2025 14:44:22 +0100 Subject: [PATCH] Tweak minimal checks for GUI binding installs. Make the wx test a one-liner like other backends. Use PyQt6 as default qt (matching the default in qt_compat). --- galleries/users_explain/figure/backends.rst | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/galleries/users_explain/figure/backends.rst b/galleries/users_explain/figure/backends.rst index b808d5951fd8..85ed8dece23d 100644 --- a/galleries/users_explain/figure/backends.rst +++ b/galleries/users_explain/figure/backends.rst @@ -292,14 +292,12 @@ program that can be run to test basic functionality. If this test fails, try re QtAgg, QtCairo, Qt5Agg, and Qt5Cairo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Test ``PyQt5``. - -If you have ``PySide`` or ``PyQt6`` installed rather than ``PyQt5``, just change the import -accordingly: +Test ``PyQt6`` (if you have ``PyQt5``, ``PySide2`` or ``PySide6`` installed +rather than ``PyQt6``, just change the import accordingly): .. code-block:: bash - python -c "from PyQt5.QtWidgets import *; app = QApplication([]); win = QMainWindow(); win.show(); app.exec()" + python3 -c "from PyQt6.QtWidgets import *; app = QApplication([]); win = QMainWindow(); win.show(); app.exec()" TkAgg and TkCairo @@ -325,14 +323,9 @@ wxAgg and wxCairo Test ``wx``: -.. code-block:: python3 - - import wx +.. code-block:: bash - app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window. - frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window. - frame.Show(True) # Show the frame. - app.MainLoop() + python3 -c "import wx; app = wx.App(); frame = wx.Frame(None); frame.Show(); app.MainLoop()" If the test works for your desired backend but you still cannot get Matplotlib to display a figure, then contact us (see :ref:`get-help`).