Contents
The standard way for Tau application to show one-dimensional data is by using a TaurusPlot widget.
TaurusPlot is shown as an area with X and Y axes where curves (data sets) are plotted. It may also show a legend.
But the 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.
You may also use TaurusPlot as a stand-alone application for displaying attributes from the control system or for plotting a function. You can launch the stand-alone TaurusPlot with the following command:
taurusplot [options] [<model_list>]
Options:
-h, --help show this help message and exit
-x t|n, --x-axis-mode=t|n
interprete X values as either timestamps (t) or
numbers (n). Accepted values: t|n (e is also accepted
as a synonim of n)
--config=CONFIG_FILE, --config-file=CONFIG_FILE
use the given config file for initialization
--export=EXPORT_FILE, --export-file=EXPORT_FILE
use the given file to as output instead of showing the
plot
--version show program's version number and exit
Taurus Options:
Basic options present in any taurus application
--taurus-log-level=LEVEL
taurus log level. Allowed values are (case
insensitive): critical, error, warning/warn, info,
debug, trace
--taurus-polling-period=MILLISEC
taurus global polling period in milliseconds
--taurus-serialization-mode=SERIAL
taurus serialization mode. Allowed values are (case
insensitive): serial, concurrent (default)
--tango-host=TANGO_HOST
Tango host name
The <model_list> is a space-separated list of models for TaurusPlot. Valid models are: SPECTRUM attribute names or alias, and Xattrname|Yattrname constructions for indicating X-Y scatter plots. See TaurusPlot API for more information about valid models
A TaurusPlot has a X axis and one or two Y axes (left and right, also called Y1 and Y2 and drawn in black and blue, respectively). Multiple curves can be displayed simultaneously and each one will be associated to either Y1 or Y2.
By default, TaurusPlot only shows a legend when more than one curve is displayed (this behavior can be overridden using the TaurusPlot context menu).
Curves associated to the Y1 axis show their title in the legend using black text, while those associated to Y2 use blue text.
You can change the axis to which a curve is associated by clicking on its title in the legend. There are three states: associated to Y1 (black legend text), associated to Y2 (blue legend text), and hidden (the curve is not displayed and its title in the legend becomes gray).
You can also change the axis to which a curve is associated using the Plot Configuration dialog.
There are several ways of changing the scales interactively:
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 automatically 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) as well as by selecting some of them and using the Curve Title(s)... button.
On the bottom part you can control the scales for all axes (X, Y1 and Y2):
When TaurusPlot is used in a GUI, it is likely that some data is already plotted on it. But, say that you want to compare it against some function, or against data stored in a file, or even against some attribute of the control system...
...then the Input data selection option from the TaurusPlot context menu is for you!
From the Attributes tab of the import data dialog, you can choose which Tango attributes are plotted, thanks to a TaurusModelChooser widget.
If the data you want to plot is not an attribute, go to the Raw Data tab, where you can add data sets to the plot from the following sources:
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 Store 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.
Important: note that if you saved the settings of a plot which displayed an attribute from the control system, the actual values shown when restoring the settings will be updated with the attribute value
Sometimes you want to know more about the values being plotted. The following features can be useful:
Obtaining coordinates of the plot area: you can get the coordinates (in the X-Y1 system) for any arbitrary point of the plot by simply clicking on it.
Data Inspector: you can inspect the value of any given data point by entering in
Inspector mode. You can toggle this mode this by pressing the “I” key or via
the TaurusPlot context menu (the cursor over the plot will change from the
usual cross to something like this: , depending on the system).
Once in data inspector mode, you can click on a data point, which will be
marked and some information about it will be displayed:
Peak locator: TaurusPlot can locate and put a mark at the maximum and/or minimum points in the plotted data. You switch this option on and off using the Show Peaks option from the TaurusPlot context menu or use from the Peak Markers option in the Plot Configuration dialog
Finally, if you want to see a text list of all the data being plotted, you can also do it from the Export to ASCII Dialog from the TaurusPlot context menu
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.
You can access them from the TaurusPlot context menu and for the moment they allow you to:
Print the plot.
Create a PDF from the plot. Note that it is not a simple screenshot, but a proper vectorial PDF (this means you can zoom in without loosing resolution).
This will save the data in plain ASCII text format. If the plot is showing more than one curve, you can choose between:
(note that you can also use this dialog to inspect the data and to copy it to the clipboard)
The titles of the curves (which are displayed in the legend) can be customised in several ways:
In some applications, the values of the X axis are interpreted as date/time values (this is set either by the GUI using TaurusPlot, or by the -xt parameter if TaurusPlot is being launched 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:
When working in time mode, the X axis in the Plot Configuration dialog changes to “Time”, and the Min/Max entries change to Start/End, where you can enter a date (and, optionally a time).
Here are some tips for entering valid date/time values: