From 56a755244c6c1c7ff8783dd41bee66950d982031 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 26 Aug 2017 11:02:50 -0400 Subject: [PATCH 1/3] DOC: re-order the interactive backends in an opinionated way Also add IPython magic details --- tutorials/introductory/usage.py | 50 ++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 9c1bd26d22ec..d659597d0e88 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -399,10 +399,6 @@ def my_plotter(ax, data1, data2, param_dict): # :term:`pdf` # :term:`svg` # ... -# :term:`GDK` :term:`png` :term:`raster graphics` -- -# :term:`jpg` the `Gimp Drawing Kit`_ Deprecated in 2.0 -# :term:`tiff` -# ... # ============= ============ ================================================ # # And here are the user interfaces and renderer combinations supported; @@ -413,27 +409,41 @@ def my_plotter(ax, data1, data2, param_dict): # ============ ================================================================ # Backend Description # ============ ================================================================ -# GTKAgg Agg rendering to a :term:`GTK` 2.x canvas (requires PyGTK_ and -# pycairo_ or cairocffi_; Python2 only) +# Qt5Agg Agg rendering in a :term:`Qt5` canvas (requires PyQt5_). This +# backend can be activated in IPython with ``%matplotlib qt5``. +# ipympl Agg rendering embedded in a Jupyter widget. This can be enabled +# in a Jupyter notebook with ``%matplotlib ipympl`` # GTK3Agg Agg rendering to a :term:`GTK` 3.x canvas (requires PyGObject_ # and pycairo_ or cairocffi_) -# GTK GDK rendering to a :term:`GTK` 2.x canvas (not recommended and d -# eprecated in 2.0) (requires PyGTK_ and pycairo_ or cairocffi_; -# Python2 only) -# GTKCairo Cairo rendering to a :term:`GTK` 2.x canvas (requires PyGTK_ -# and pycairo_ or cairocffi_; Python2 only) +# This backend can be activated in IPython with +# ``%matplotlib gtk3``. +# macosx Agg rendering into a Cocoa canvas in OSX. +# This backend can be activated in IPython with +# ``%matplotlib osx``. +# TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_). +# This backend can be activated in IPython with +# ``%matplotlib tk``. +# nbAgg Embed an interactive figure in a Jupyter classic notebook. This +# backend can be enabled in Jupyter notebooks via +# ``%matplotlib notebook``. +# WebAgg On ``show()`` will start a tornado server with an interactive +# figure. # GTK3Cairo Cairo rendering to a :term:`GTK` 3.x canvas (requires PyGObject_ # and pycairo_ or cairocffi_) +# Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_ +# or ``pyside``). +# This backend can be activated in IPython with +# ``%matplotlib qt4``. +# GTKAgg Agg rendering to a :term:`GTK` 2.x canvas (requires PyGTK_ and +# pycairo_ or cairocffi_; Python2 only) +# This backend can be activated in IPython with +# ``%matplotlib gtk``. +# GTKCairo Cairo rendering to a :term:`GTK` 2.x canvas (requires PyGTK_ +# and pycairo_ or cairocffi_; Python2 only) # WXAgg Agg rendering to a :term:`wxWidgets` canvas -# (requires wxPython_) -# WX Native :term:`wxWidgets` drawing to a :term:`wxWidgets` Canvas -# (not recommended and deprecated in 2.0) (requires wxPython_) -# TkAgg Agg rendering to a :term:`Tk` canvas (requires TkInter_) -# Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_ or ``pyside``) -# Qt5Agg Agg rendering in a :term:`Qt5` canvas (requires PyQt5_) -# macosx Cocoa rendering in OSX windows -# (presently lacks blocking show() behavior when matplotlib -# is in non-interactive mode) +# (requires wxPython_). +# This backend can be activated in IPython with +# ``%matplotlib wx``. # ============ ================================================================ # # .. _`Anti-Grain Geometry`: http://antigrain.com/ From 1847d22682ed7bc1ff219de987663ced49e82df0 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 26 Aug 2017 12:08:17 -0400 Subject: [PATCH 2/3] DOC: adjust backend docs header levels --- tutorials/introductory/usage.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index d659597d0e88..631e0b823360 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -284,10 +284,13 @@ def my_plotter(ax, data1, data2, param_dict): # Again, for these simple examples this style seems like overkill, however # once the graphs get slightly more complex it pays off. # +# Backends +# ======== +# # .. _what-is-a-backend: # # What is a backend? -# ================== +# ------------------ # # A lot of documentation on the website and in the mailing lists refers # to the "backend" and many new users are confused by this term. @@ -462,7 +465,7 @@ def my_plotter(ax, data1, data2, param_dict): # .. _PyQt5: https://riverbankcomputing.com/software/pyqt/intro # # WX backends -# =========== +# ----------- # # At present the release version of `wxPython` (also known as wxPython classic) # does not support python3. A work in progress redesigned version known as @@ -472,7 +475,7 @@ def my_plotter(ax, data1, data2, param_dict): # .. _wxPython-Phoenix: https://wxpython.org/Phoenix/docs/html/main.html # # GTK and Cairo -# ============= +# ------------- # # Both `GTK2` and `GTK3` have implicit dependencies on PyCairo regardless of the # specific Matplotlib backend used. Unfortunatly the latest release of PyCairo @@ -481,7 +484,7 @@ def my_plotter(ax, data1, data2, param_dict): # wrapper. # # How do I select PyQt4 or PySide? -# ======================================== +# -------------------------------- # # You can choose either PyQt4 or PySide when using the `qt4` backend by setting # the appropriate value for `backend.qt4` in your :file:`matplotlibrc` file. The From c201bb93459890289ca2312969cd46f8447177a5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 28 Aug 2017 21:04:31 -0400 Subject: [PATCH 3/3] DOC: update wxPython data v4.0 supports python3 --- tutorials/introductory/usage.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 631e0b823360..bc1b4effbf12 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -444,7 +444,8 @@ def my_plotter(ax, data1, data2, param_dict): # GTKCairo Cairo rendering to a :term:`GTK` 2.x canvas (requires PyGTK_ # and pycairo_ or cairocffi_; Python2 only) # WXAgg Agg rendering to a :term:`wxWidgets` canvas -# (requires wxPython_). +# (requires wxPython_. v4.0 (in beta) is +# required for python3). # This backend can be activated in IPython with # ``%matplotlib wx``. # ============ ================================================================ @@ -464,16 +465,6 @@ def my_plotter(ax, data1, data2, param_dict): # .. _PyQt4: https://riverbankcomputing.com/software/pyqt/intro # .. _PyQt5: https://riverbankcomputing.com/software/pyqt/intro # -# WX backends -# ----------- -# -# At present the release version of `wxPython` (also known as wxPython classic) -# does not support python3. A work in progress redesigned version known as -# wxPython-Phoenix_ does support python3. -# Matplotlib should work with both versions. -# -# .. _wxPython-Phoenix: https://wxpython.org/Phoenix/docs/html/main.html -# # GTK and Cairo # ------------- #