File: plot.rst

package info (click to toggle)
taurus 5.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 100,792 kB
  • sloc: python: 51,356; sh: 67; makefile: 12
file content (186 lines) | stat: -rw-r--r-- 6,161 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.. currentmodule:: taurus.qt.qtgui.plot

.. _taurusplot_ui:

============================
TaurusPlot User's Interface
============================

.. contents::

.. todo:: These docs need to be updated to the taurus_pyqtgraph implementation

The standard way for Taurus applications to show one-dimensional data is by
using a :class:`TaurusPlot` widget.
    
:class:`TaurusPlot` is shown as an area with X and Y axes where curves (data sets)
are plotted. It may also show a legend.

.. figure:: /_static/taurusplot04.png
  :align: center

But the :class:`TaurusPlot` does a lot more than just showing a plot. It allows
the user to interact with the plot in many ways as described below.

.. note:: The features described here are available *by default* in all TaurusPlot 
          widgets, but certain GUIs may choose to disable some of these features.

.. _standalonetaurusplot:

TaurusPlot as a Stand-alone application
---------------------------------------

You may also use :class:`TaurusPlot` as a stand-alone application for displaying
attributes from the control system or for plotting a function. You can launch the
stand-alone :class:`TaurusPlot` with the following command::

    taurus plot [options] [<model_list>]
	
Run the following command for more details::

    taurus plot --help

The <model_list> is a space-separated list of models for :class:`TaurusPlot`.
See :class:`TaurusPlot` API for more information about valid models

Working with two Y scales
-------------------------

A :class:`TaurusPlot` has a X axis and one or two Y axes (left and right, also
called Y1 and Y2, respectively).
Multiple curves can be displayed simultaneously and each one will be associated
to either Y1 or Y2.

By default, :class:`TaurusPlot` only shows a legend when more than one curve is displayed
(this behavior can be overridden using the `TaurusPlot context menu`_).

You can change the axis to which a curve is associated using the
`Plot Configuration dialog`_.

.. _taurusplotcontextmenu:

TaurusPlot context menu
-----------------------

Most of the options of a :class:`TaurusPlot` can be managed from a context menu that is
shown when right clicking on the plot area:

.. figure:: /_static/taurusplot-context01.png
   :align: center

Right-clicking on an axis will show a context menu with the specific options
for that axis.

Zooming and panning
-------------------

There are several ways of changing the scales interactively:

- The plots can be zoomed in and out by holding the right mouse button and
  moving the mouse. Using the wheel mouse is also allowed. For Zooming on an
  specific axis, do those actions over the specific axis.
- Panning (i.e. translating without scaling) is done by holding the middle
  mouse button and moving the mouse.
- The small "A" icon on the bottom-left corner of the plot resets the zooms
  and returns to auto-scale mode.
- Finally, all details about the scales are accessible at the axis submenus
  from the `TaurusPlot context menu`_.


.. _plotconfiguration:
  
Plot Configuration dialog
-------------------------

.. figure:: /_static/taurusplot-config01.png
   :align: center
   
This dialog can be accessed from the `TaurusPlot context menu`_.

On its top section you can customize the look of the displayed data (line type,
symbols used, colors, thicknesses, associated axis,...).
Any changes will be applied to all the curves selected from the list on the left.

The curve titles can be changed by editing them directly in the list (one by
one).


Choosing what is plotted
------------------------
When :class:`TaurusPlot` is used in a GUI, it is likely that some data is
already plotted on it. But it is possible to add other data: use the
`Model selection` option from the `TaurusPlot context menu`_.


Storing and recovering current configuration
---------------------------------------------

Once you have customized the way the plot looks (see the
`Plot Configuration dialog`_ section), you may want to save the settings for
later use. This can be done using the `Save current settings` option from the
`TaurusPlot context menu`_.

This will save which curves should be plotted and how they should look.

You can restore those settings at any point by using the `retrieve current settings`
option from the `TaurusPlot context menu`_.


Obtaining information about the plotted values
-----------------------------------------------

Sometimes you want to know more about the values being plotted. The following
features can be useful:

- Data Inspector: you can inspect the value of any given data point by entering in
  *Inspector mode*. You canenable it via the `TaurusPlot context menu`_ .

  .. image:: /_static/taurusplot-datainfo02.png


Exporting and printing the data
-------------------------------

You want a figure for a logbook?

Or you want to store the plotted values in a file?

Then you will like the Export capabilities of TaurusPlot (accessible from the
`TaurusPlot context menu`_ ). From this action you can export into various
image and data formats:



Customizing the titles of the curves
------------------------------------

The titles of the curves (which are displayed in the legend) can be customised
in several ways:

- Through the `Change Curves Titles...` option in the `TaurusPlot context menu`_
- Through the `Plot Configuration dialog`_ (either editing the name
  individually, or selecting several curves and clicking on the `Curve Title(s)...` button)
    
.. _taurusplottime:

Date/time support
-----------------

In some applications, the values of the X axis are interpreted as date/time
values (this is set by using the `-xt` parameter when launching TaurusPlot
from the command line).

In this mode, the values of the abscissas must be valid epoch numbers, i.e.
seconds since the "beginning of times" (UNIX t=0 : 1970-01-01 01:00:00).
TaurusPlot will interpret such values and display well-formatted dates and times
instead of the epoch number:

.. image:: /_static/taurusplot-timesupport01.png


.. references
.. _numpy: http://numpy.scipy.org/
.. _guiqwt: http://pypi.python.org/pypi/guiqwt


.. |inspector_icon| image:: /_static/whatsthiscursor.png