Keys and Values

Below are dictionary key: value pairs, followed by a description, for each of the figio dictionary constitutents.

Main figio Dictionary

The figio dictionary is the main dictionary.

  • It is stored in an ordinary text file in yml format.
  • It is composed of one or more model dictionaries and one or more view dictionaries.
model_name:dictThe key model_name is a string that must be a globally unique identifier (guid) in the yml file. Contains the model dictionary. Non-singleton; supports 1..m models.
view_name:dictThe key view_name is a string that must be a globally unique identifier (guid) in the yml file. The key Contains the view dictionary. Non-singleton, supports 1..n views.

Note: In general, this view_name key can be any unique string. However, when the yml input file is to be used with the unit tests, this view_name key string must be exactly set to figure for the unit tests to work properly.

There are three common variations to the figio dictionary:

  • 1:1
    • One model
    • One view
    • This is the most basic option.
  • 1:n
    • Several models
    • One view
    • This is an advanced option, wherein multiple models are plotted to the same figure. Considerations such as y-axis limits or the possibility of dual y-axes can become important.
  • m:n
    • Several models
    • Several views
    • This is the most advanced combination of the three, where all the models are created, and views explicity specify which models get plotted to a particular figure.

Signal processing may be performed on one or more models, using the signal_process dictionary, to create a new model, which can also be used by the view. A conceptual flow diagram of multiple models, one with signal processing, and one view is shown below.

┌───────────────┐                                                    ┌───────────────┐
│     Model     │─────────────────────────┐                          │               │
└───────────────┘                         │                          │               │
                                          │                          │               │
┌───────────────┐                         │                          │               │
│     Model     │─────────────────────────┤                          │               │
└───────────────┘                         │                          │               │
        │                                 │                          │     View      │
                                          ├─────────────────────┬───▶│               │
        │                                 │                     │    │               │
┌───────────────┐                         │                     │    │               │
│     Model     │──┬──────────────────────┘                     │    │               │
└───────────────┘  │   ┌───────────────┐                        │    │               │
                   │   │    Signal     │    ┌───────────────┐   │    │               │
                   └──▶│    Process    │───▶│     Model     │───┘    │               │
                       └───────────────┘    └───────────────┘        └───────────────┘

Model Dictionary

The model dictionary contains items that describe how each (x,y) data set is constructed and shown on the view.

type:xymodel hmodelFor (x, y) data and time series data, type: xymodel items associate with type: xyview items. For histogram data, type: hmodel items associate with type: hview items.
folder:stringValue of the absolute file path to the file. Supports ~ for user home constructs ~/my_project/input_files as equilvalent to, for example, /Users/chovey/my_project/input_files. For the current working directory, use ./.
file:stringValue of the comma separated value input file in csv (comma separated value) format. The first column is the x values, the second column(s) is(are) the y value(s). The csv file can use any number of header rows. Do not attempt to plot header rows; skip header rows with the skip_rows key.
skip_rows:integeroptional
The number of header rows to skip at the beginning of the csv file. Default value is 0.
skip_rows_footer:integeroptional
The number of footer rows to skip at the end of the csv file. Default value is 0.
xcolumn:integeroptional
The zero-based index of the data column to plotted on the x-axis. Default is 0, which is the first column of the csv file.
ycolumn:integeroptional
The zero-based index of the data column to be plotted on the y-axis. Default is 1, which is the second column of the csv file.
xscale:floatoptional
Scales all values of the x data xscale factor. Default value is 1.0 (no scaling). xscale is applied to the data prior to xoffset.
xoffset:floatoptional
Shifts all values of the x data to the left or the right by the xoffset value. Default value is 0.0. xoffset is applied to the data after xscale.
yscale:floatoptional
Scales all values of the y data yscale factor. Default value is 1.0 (no scaling). yscale is applied to the data prior to yoffset.
yoffset:floatoptional
Shifts all values of the y data up or down by the yoffset value. Default value is 0.0. yoffset is applied to the data after yscale.
plot_kwargs:dictSingleton that contains the plot keywords dictionary.
signal_process:dictSingleton that contains the signal processing keywords dictionary.

Plot Keywords Dictionary

Dictionary that overrides the matplotlib.pyplot.plot() kwargs default values. Default values used by figio follow:

linewidth:floatoptional
Default value is 2.0. See matplotlib lines Line2D for more detail.
linestyle:stringoptional
Default value is "-", which is a solid line. See matplotlib linestyles for more detail.

Some frequently used optional values follow.
If the keys are omitted, then the matplotlib defaults are used.


marker:stringoptional
The string to designate a marker at the data point. See matplotlib marker documentation.
label:stringoptional
The string appearing in the legend correponding to the data.
color:stringoptional
The matplotlib color used to plot the data. See also matplotlib color defaults and predefined color names.
alpha:floatoptional
Real number in the range from 0.0 to 1.0. Numbers toward 0.0 are more transparent and numbers toward 1.0 are more opaque.

Signal Processing Keywords Dictionary

Warning: The Signal Processing dictionary and links below are a work in progress.

This dictionary is currently under active development. For additional documentation, see

Below is a summary of the key: value pairs available within the signal_process dictionary.

        signal_process:
            process_guid_1:
                butterworth:
                    cutoff: 5
                    order: 4
                    type: low
            process_guid_2:
                gradient:
                    order: 1
            process_guid_3:
                integration:
                    order: 3
                    initial_conditions: [-10, 100, 1000]
            process_guid_4:
                crosscorrelation:
                    model_keys: [model_guid_0, model_guid_1]
                    mode: full # (valid | same)
            process_guid_5:
                tpav: { (tpav is three points angular velocity)
                    model_keys: [model_guid_0, model_guid_1, model_guid_2]

All processes support serialization, via

        signal_process:
            process_guid:
                process_key_string:
                    serialize: 1
                    folder: ~/sibl/cli/io/example
                    file: processed_output_file.csv

View Dictionary

The view dictionary contains items that describe how the main figure is constructed.

type:xyview hviewFor (x, y) data and time series data, type: xymodel items associate with type: xyview items. For histogram data, type: hmodel items associate with type: hview items.
model_keys:string arrayoptional
[model_guid_0, model_guid_1, model_guid_2] (for example), an array of 1..m strings that identifies the model guid to be plotted in this particular view. If model_keys is not specified in a particular view, then all models will be plotted to the view, which is the default behavior.
folder:stringValue of the absolute file path to the file. Supports ~ for user home constructs ~/my_project/output_files as equilvalent to, for example, /Users/chovey/my_project/output_files.
file:stringValue of the figure output file (e.g., my_output_file.png) in .xxx format, where xxx is an image file format, typically pdf, png, or svg.
size:float arrayoptional
Array of floats containing the [width, height] of the output figure in units of inches. Default is [11.0, 8.5], U.S. paper, landscape. Example
dpi:integeroptional
Dots per inch used for the output figure. Default is 300. Example
xlim:float arrayoptional
Array of floats containing the x-axis bounds [x_min, x_max]. Default is MATLABLIB's automatic selection.
ylim:float arrayoptional
Array of floats containing the y-axis bounds [y_min, y_max]. Default is matplotlib's automatic selection.
title:stringoptional
Figure label, top and centered. Default is default title.
xlabel:stringoptional
The label for the x-axis. Default is default x axis label.
ylabel:stringoptional
The label for the left-hand y-axis. Default is default y axis label.
frame:Booleanoptional
Visibility of the rectangular frame draw around an axis.
0 The frame is hidden.
1 (default) The frame is shown.
tick_kwargs:dictoptional
Singleton that controls ticks, tick labels, and gridlines per matplotlib's tick_params dictionary.
Example:
tick_params: {colors: darkgray, labelsize: 8, width: 0.1}
xticks:float arrayoptional
Contains an array of ascending real numbers, indicating tick placement. Example: [0.0, 0.5, 1.0, 1.5, 2.0]. Default is matplotlib's choice for tick marks.
yticks:float arrayoptional
Same as documentation for xticks.
xaxis_log:Booleanoptional
0 (default) plots x-axis in a linear scale.
1 plots x-axis in a log scale.
yaxis_log:Booleanoptional
0 (default) plots y-axis in a linear scale.
1 plots y-axis in a log scale.
yaxis_rhs:dictoptional
Singleton that contains the yaxis_rhs dictionary.
background_image:dictoptional
Singleton that contains the background_image dictionary.
display:Booleanoptional
0 to suppress showing figure in GUI, useful when serializing multiple figures during a parameter search loop.
1 (default) to show figure interactively, and to pause script execution.
latex:stringoptional
0 (default) uses matplotlib default fonts, results in fast generation of figures.
1 uses LaTeX fonts, can be slow to generate, but produces production-quality results.
details:Booleanoptional
0 do not show plot details.
1 (default) shows plot details of figure file name, date (yyyy-mm-dd format), and time (hh:mm:ss format) the figure was generated, and username.
serialize:stringoptional
0 (default) does not save figure to the file system.
1 saves figure to the file system. Tested on local drives, but not on network drives.

yaxis_rhs Dictionary

scale:stringoptional
The factor that multiplies the left-hand y-axis to produce the right-hand y-axis. For example, if the left-hand y-axis is in meters, and the right-hand y-axis is in centimeters, the value of scale should be set to 100. Default value is 1.
label:stringoptional
The right-hand-side y-axis label. Default is an empty string (None).
yticks:float arrayoptional
Same as documentation for xticks.

background_image Dictionary

folder:stringValue relative to the current working directory of the path and folder that contains the background image file. For the current working directory, use ./.
file:stringValue of the background image file name, typically in png format.
left:floatoptional
Left-side extent of image in plot x coordinates. Must be less than the right-side extent. Default is 0.0.
right:floatoptional
Right-side extent of image in plot x coordinates. Must be greater than the left-side extent. Default is 1.0.
bottom:floatoptional
Bottom-side extent of image in plot y coordinates. Must be less than the top-side extent. Default is 0.0.
top:floatoptional
Top-side extent of image in plot y coordinates. Must be greater than the bottom-side extent. Default is 1.0.
alpha:floatoptional
Real number in the range from 0 to 1. Numbers toward 0 are more transparent and numbers toward 1 are more opaque. Default is 1.0 (fully opaque, no transparency).