Options

October 5, 2021 ยท View on GitHub

This document details each option in graph-cli. There are two "types" of options: global and line specific. Global options are attributes like the title or ylabel, and line specific options are attributes like width and style.

General Notes

These notes explain some features that might not be obvious.

  • All line specific options can be a comma separated list of values
  • Due to argparse quirks, options that need to start with - must be written using --opt=val (this includes negative values in ranges)
    • Example: --style='-.'
    • Example: --yrange=-0.5:1.0
  • The annotate flag will cycle through available lines if only xpos is specified
  • Time formats use the C standard format codes
    • epoch may be used as a special input-time format to interpret the column as seconds or milliseconds since Unix epoch

Required Options

OptionDescription
CSVthe CSV file containing the data to graph. Use - to read from stdin.

Global Options

These options persist across chains and are generally set only once.

LongShortDefaultDescription
--xlabel-Xmatch xcolthe x-axis label
--xscaleautothe x-axis scaling
--xrangeautothe x-axis window (min:max)
--ylabel-Ymatch ycolthe y-axis label
--yscaleautothe y-axis scaling
--yrangeautothe y-axis window (min:max)
--figsize16x10figure dimensions (XxY)
--title-Tylabel vs. xlabeltitle of the graph
--fontsize18font size on graph
--tick-fontsize10font size of tick labels
--label-fontsize10label font size
--xtick-fontsize10font size of xtick labels
--xtick-angle0xtick label angle in degrees
--xtick-aligncenterxtick label text alignment
--xlabel-fontsize10xlabel font size
--ytick-fontsize10font size of ytick labels
--ytick-angle0ytick label angle in degrees
--ytick-aligncenterytick label text alignment
--ylabel-fontsize10ylabel font size
--grid-.grid linestyle
--no-gridfalsedisable grid
--text-tadd text to the graph (xpos=text | xpos:ypos=text)
--annotate-aadd annotation (text and arrow) to the graph (xpos=text | xpos:ycol=text | xtext:ytext:xpos:ypos=text)
--time-format-output-Fautotime format to use for the x-axis
--no-tightfalsedisable tight layout
--chain-Cfalseuse this option to combine graphs into a single image

Line Specific Options

These options are specific to each invocation of graph-cli and can be used to customize each line. Generally speaking, each of these options can be a comma separated list.

LongShortDefaultDescription
--xcol-x1the column number or name to use for the x-axis
--ycol-yall other columnsthe column number or name to use for the y-axis
--legend-lmatch ycolthe label name for the legend
--color-cautothe color of the line
--styleautothe style of the line
--fillfalsefill in beneath the lines
--marker-momarker style of the data points
--width-wline: 2, bar: 0.8line or bar width size
--offset0bar chart base offset
--markersize2marker (point) size
--output-osave the graph to a file
--time-format-input-fautotime format of timeseries column (this option can speed up processing of large datasets)
--resample-rresample values and take the mean (can be used with timeseries data as well)
--resample-actionmeanaction to take when resampling (mean, median, etc.) See docs for a full list and description
--sort-sfalsesort by xcol values
--barfalsecreate a bar graph
--barhfalsecreate a barh graph (horizontal bars)
--bar-labelfalselabel bars with their values
--bar-format%gformat specifier for bar labels