PlottingRules
Plotting rules - current status
Firstly and most important, plotting attributes are given to a MeqDataCollect mode as part of an 'attrib' record. The 'attrib' record itself is part of an 'extra' record along with a "Visu" specification. e.g.
mqs.meq('Create.Node',meq.node('MeqDataCollect','xx',children=child_str1, extra = [top_label = hiid("Visu"), attrib=attrib_rec_yx]));
The 'attrib' record itself, can contain either or both a 'plot' or 'tag' subrecord. e.g. the 'attrib_rec_yx' record given above could be constructed as:
attrib_yx1 := [color="black", plot_type= "spectra"]; attrib_rec_yx := [=] attrib_rec_yx.plot := attrib_yx1 attrib_rec_yx.tag := "YX test"
In glish, 'tag' fields should be specified within double quotes, as above. This will cause them to be turned into a vector of strings e.g. ('YX','test')
The 'plot' subrecord, will contain a record of allowable plotting specifications e.g. as shown above attrib_yx1 := [color="black", plot_type= "spectra"];
A visualization tree can be constructed by joining a number of MeqDataCollect nodes into a Meqtree. Each MeqDataCollect 'Visu' node can be given its own 'attrib' record of plotting information as shown above. Since each MeqDataCollect can have its own set of plotting parameters, a series of rules has been specified regarding how plot parameters given at various levels in the tree are combined to form a 'final set of plot specifications when several MeqDataCollect nodes have been joined together into a tree.
For most parameters, a downstream (toward the root of the tree) specification overrides an upstream (toward the leaves of the tree) specification. So, for instance, individual leaves of a tree might be told to plot 'spectra' but if a parent root node has been told to plot 'realvsimag' then if the user clicks on the parent 'Visu' node, a 'realvsimag' plot will be produced.
A few parameters, such as the attrib.tag field, are amalgamated as we go through the tree.
Only leaf nodes in the tree have actual plot data. As we traverse a 'Visu' tree a list of attribute records is collected. When we get to a leaf node, the leaf node goes through the list of attribute records to obtain the actual parameters it will use to construct its part of the plot. The attribute list is in the order root -> ... -> leaf, so for those attibutes where a parent's value overrides those of a child, as soon as a particular attribute is found it is ignored for the remainder of the list.
We now give a list of the attrib.plot key words and their allowable values. For those keywords with choices, the default, if nothing is specified, is the first value in the list. e.g. the default for color is 'blue' while the default spectrum_color for a 'spectra' plot is 'hippo' - the color display used in the HippoDraw package.
Key word allowable values
================ =============================
plot_type | type realvsimag | spectra
results_buffer integer value - number of result plots to be buffered for redisplay
The following key_words have meaning for a 'realvsimag' plot
mean_circle F | T
stddev_circle F | T
mean_arrow F | T
mean_circle_style (see line_style below)
mean_circle_color (see color below)
stddev_circle_style (see line_style below)
stddev_circle_color (see color below)
symbol_size integer number (default = 10 pixels)
symbol one of
'circle' 'none' 'rectangle' 'square' 'ellipse'
'none' 'xcross' 'cross' 'triangle' 'diamond' 'dot'
line_style one of
'dots' 'lines' 'none'
'SolidLine' 'DashLine' 'DotLine' 'DashDotLine' 'DashDotDotLine'
'solidline' 'dashline' 'dotline' 'dashdotline' 'dashdotdotline'
note: 'dots' == 'none', ie. it means that the data are just represented by their
symbol, whatever that is, and there is no connection between the data points.
value_tag single word
error_tag single word
title string (in Glish surrounded by single
quotation (') marks
color one of
'blue' 'black' 'cyan' 'gray' 'green' 'none'
'magenta' 'red' 'white' 'yellow' 'darkBlue' 'darkCyan'
'darkGray' 'darkGreen' 'darkMagenta' 'darkRed' 'darkYellow'
'lightGray'
legend (glish record)
with fields - plot glish string
- popup glish string
(popup is not yet implemented)
The contents of 'legend' are amalgamated as we traverse a tree.
x_axis glish string
y_axis glish string
The following key_word has meaning for a 'spectra' plot
spectrum_color one of
'hippo' 'grayscale' 'brentjens'
Notes on key words:
value_tag and error_tag: If a MeqDataCollect leaf node ends up getting both a value_tag and a error_tag keyword it will assume that it is to produce a special variant of the realvsimag plot in which there are two data sources, one with 'values' and a second with the 'errors' associated with the values. If the leaf node has a 'tag' field which contains the 'value_tag' label, then the leaf node knows it is handling the data values. If a leaf node has a tag which contains the 'error_tag' label then it knows that it is handling the associated 'error' data.