multi_chart - bruno-beloff/scs_analysis GitHub Wiki

docs > software repositories > scs_analysis > commands > charting


DESCRIPTION

The multi_chart utility is used to display a Matplotlib categorical chart for one or more data sources. The data sources share a common y-axis scale. Data is provided by a sequence of JSON documents on stdin. Each charting source is specified by a path to a leaf node in the JSON document.

An optional "batch" ("-b") flag can be set, causing the plotting only to take place when all data points have been received.

Note that the chart is a simple approximation to a timeline chart - values are plotted successively, with no account taken of the interval between samples.

On Linux, it may be necessary to install tkinter in order for the chart to be displayed:

sudo apt-get install python3-tk

Depending on operating system, it may be necessary to use a matplotlibrc file, which specifies the Matplotlib back-end graphics system.

SYNOPSIS

multi_chart.py [-b] [-x POINTS] [-y MIN MAX] [-e] [-t TITLE] [-v] PATH_1 .. PATH_N

Options
--version show program's version number and exit
-h, --help show this help message and exit
-b, --batch wait for all data before displaying chart
-x X, --x=X number of x points (default 600)
-y Y, --y=Y set y-axis to min / max (default -10, 10)
-e, --echo echo stdin to stdout
-t TITLE, --title=TITLE optional chart title
-v, --verbose report narrative to stderr

EXAMPLES

socket_receiver.py | ./multi_chart.py val.opc.pm10 val.opc.pm2p5 val.opc.pm1 -x 120 -e

FILES

~/SCS/scs_analysis/src/scs_analysis/matplotlibrc

SEE ALSO

scs_analysis/histo_chart
scs_analysis/single_chart

RESOURCES

Matplotlib: What is a backend?
Stackoverflow: "UserWarning: Matplotlib is currently using agg, which is a non-gui backend...

BUGS

On some operating systems, the chart will remain as the uppermost window until all data have been received.