From 72e7e7d7fd37635e26b598bd6c83007d91c48d91 Mon Sep 17 00:00:00 2001 From: story645 Date: Sun, 20 Mar 2016 23:16:45 -0400 Subject: [PATCH 1/2] Proposed fix for #5517 Amended the documentation as suggested by @tacaswell in #5517 --- doc/faq/usage_faq.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/faq/usage_faq.rst b/doc/faq/usage_faq.rst index 4c5e7f23ed0..572f659bca3 100644 --- a/doc/faq/usage_faq.rst +++ b/doc/faq/usage_faq.rst @@ -545,9 +545,10 @@ can type additional commands such as:: and you will see the plot being updated after each line. This is because you are in interactive mode *and* you are using pyplot -functions. Now try an alternative method of modifying the -plot. Get a -reference to the :class:`~matplotlib.axes.Axes` instance, and +functions. + +Now try an alternative method of modifying the +plot. Get a reference to the :class:`~matplotlib.axes.Axes` instance, and call a method of that instance:: ax = plt.gca() @@ -563,6 +564,8 @@ you need to call :func:`~matplotlib.pyplot.draw`:: Now you should see the new line added to the plot. +If this example did not work, you may need to explicitly activate the qt backend. This can most simply be done by opening an ipython prompt using `ipython --matplotlib=qt` or using the ipython magic command of `%matplotlib qt` before you import matplotlib. + Non-interactive example ----------------------- From c97f3628d1015d16c5ce6317a1a99fcc29e7952f Mon Sep 17 00:00:00 2001 From: story645 Date: Sun, 20 Mar 2016 23:45:12 -0400 Subject: [PATCH 2/2] Proposed fix for #5517 Added link to what is a backend suggestion to explicitly explain that if interactivity isn't working, you need to activate an interactive backend. --- doc/faq/usage_faq.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/faq/usage_faq.rst b/doc/faq/usage_faq.rst index 572f659bca3..3c1b0467484 100644 --- a/doc/faq/usage_faq.rst +++ b/doc/faq/usage_faq.rst @@ -522,7 +522,9 @@ and turned off via :func:`matplotlib.pyplot.ioff`. .. note:: Interactive mode works with suitable backends in ipython and in - the ordinary python shell, but it does *not* work in the IDLE IDE. + the ordinary python shell, but it does *not* work in the IDLE IDE. + If the default backend does not support interactivity, an interactive + backend can be explicitly activated using any of the methods discussed in `What is a backend?`_. Interactive example @@ -545,9 +547,7 @@ can type additional commands such as:: and you will see the plot being updated after each line. This is because you are in interactive mode *and* you are using pyplot -functions. - -Now try an alternative method of modifying the +functions. Now try an alternative method of modifying the plot. Get a reference to the :class:`~matplotlib.axes.Axes` instance, and call a method of that instance:: @@ -564,8 +564,6 @@ you need to call :func:`~matplotlib.pyplot.draw`:: Now you should see the new line added to the plot. -If this example did not work, you may need to explicitly activate the qt backend. This can most simply be done by opening an ipython prompt using `ipython --matplotlib=qt` or using the ipython magic command of `%matplotlib qt` before you import matplotlib. - Non-interactive example -----------------------