File: examples.rst

package info (click to toggle)
plotpy 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,332 kB
  • sloc: python: 36,341; cpp: 2,005; sh: 32; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 984 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Examples
--------

Using :class:`.PlotWidget`
^^^^^^^^^^^^^^^^^^^^^^^^^^

The following example shows how to use the :class:`.PlotWidget` class to create
a simple plot with a curve and a filtering tool. In this example, the plot
manager (see :class:`.PlotManager`) is not used, at least not directly:
the plot manager is integrated in the :class:`.PlotWidget` class.

.. literalinclude:: ../../../plotpy/tests/widgets/test_filtertest1.py
   :start-after: guitest:

.. image:: ../../images/screenshots/filtertest1.png

Using a plot manager
^^^^^^^^^^^^^^^^^^^^

Even if this simple example does not justify the use of the :class:`.PlotManager`
(this is an unnecessary complication here), it shows how to use it. In more complex
applications, using the :class:`.PlotManager` allows to design highly versatile
graphical user interfaces.

.. literalinclude:: ../../../plotpy/tests/widgets/test_filtertest2.py
   :start-after: guitest:

.. image:: ../../images/screenshots/filtertest2.png