Skip to content

Commit 5704ad4

Browse files
Update mpl-sliders.rst
Final edits to Examples.rst pages (3/4)
1 parent 6694176 commit 5704ad4

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

docs/examples/mpl-sliders.rst

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,22 @@ Using Matplotlib Widgets
66
When using Matplotlib widgets you need to make sure you always keep a reference to the control sliders, otherwise the callbacks
77
will be garbage collected and cease to work.
88

9-
This page is dedicated to showing how to use the ``interactive_*`` functions such as ``interactive_plot`` with Matplotlib widgets. For
9+
This page is dedicated to showing how to use the ``interactive_*`` functions---such as ``interactive_plot``---with Matplotlib widgets. For
1010
a more general discussion of how to use the ``pyplot`` submodule see the :doc:`pyplot-notebooks` page.
1111

1212
Differences from ipywidgets sliders
1313
-----------------------------------
14-
**1.**
15-
16-
mpl-sliders are different form ipywidgets sliders in that they will only take a min and and max with
17-
an optional step. Whereas for ipywidgets sliders you need to specify all the values (at least until version 8).
14+
**1.** mpl-sliders are different from ipywidgets sliders in that they will only take a min and and max with
15+
an optional step, while for ipywidgets sliders you need to specify all values (at least until version 8).
1816
A consequence of this is that the various ``interactive_*`` methods will only use the first two values of any tuples
1917
passed as a parameter (i.e. they will ignore the ``num`` argument to linspace).
2018

21-
**2.**
22-
23-
Laying out Matplotlib widgets is signifcantly more difficult than laying out elements in a webbrowser. So if you
24-
pass an existing matplotlib widget a parameter it will update the plot as expected. However the ``interactive_*``
25-
methods will not display it for you. In contrast when using ipywidgets widgets if you give a widget as a parameter
19+
**2.** Laying out Matplotlib widgets is signifcantly more difficult than laying out elements in a web browser. If you
20+
pass an existing Matplotlib widget a parameter then the plot will update as expected; however, the ``interactive_*``
21+
methods will *not* display it for you. Alternatively, when using ipywidgets widgets, if you give a widget as a parameter
2622
it will be included in the display of the controls created by the function.
2723

28-
Basic Example
24+
Basic example
2925
-------------
3026

3127
If you are not using the ``ipympl`` backend then ``mpl_interactions`` will automatically create a new figure to hold all the controls.
@@ -47,12 +43,14 @@ If you are not using the ``ipympl`` backend then ``mpl_interactions`` will autom
4743
4844
.. image:: interactive-plot-images/mpl-sliders.gif
4945

50-
Custom Positioning of Matplotlib Widgets
46+
Custom positioning of Matplotlib widgets
5147
----------------------------------------
5248

53-
There does not seem to be a consistent and simple way to layout Matplotlib widgets in the same figure as the plot that is to be controlled.
54-
So current mpl_interactions will open a new figure to place all the controls in. If you would like the sliders and the plot to live in the same
55-
figure then you will need to create your own Slider widget and use the :meth:`~mpl_interactions.interactive_plot_factory` function:
49+
There does not seem to be a consistent and simple way to layout Matplotlib widgets in the same figure as the controlled plot.
50+
To address this, mpl_interactions will open a new figure to place all the controls.
51+
52+
If you would like the sliders and the plot to live in the same figure, you will need to create your own Slider widget and use
53+
the :meth:`~mpl_interactions.interactive_plot_factory` function:
5654

5755
.. code-block:: python
5856

0 commit comments

Comments
 (0)