Command Line¶
Help:
plottoolbox --help
about¶
$ plottoolbox about --help
usage: plottoolbox about [-h]
Display version number and system information.
options:
-h, --help show this help message and exit
autocorrelation¶
$ plottoolbox autocorrelation --help
usage: plottoolbox autocorrelation [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--xlim XLIM]
[--ylim YLIM] [--grid] [--xlabel_rotation XLABEL_ROTATION]
[--ylabel_rotation YLABEL_ROTATION] [--por] [--round_index ROUND_INDEX]
[--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--plot_styles PLOT_STYLES]
The "autocorrelation" creates an autocorrelation plot.
The horizontal lines in the plot correspond to 95% and 99% confidence bands.
The dashed line is 99% confidence band.
Only available for a single time-series.
Data must be organized as 'index,y1'. Can only plot one series.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--xlabel_rotation XLABEL_ROTATION
[optional]
Rotation for major x-axis labels for plots.
--ylabel_rotation YLABEL_ROTATION
[optional]
Rotation for major y-axis labels for plots.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
bar¶
$ plottoolbox bar --help
usage: plottoolbox bar [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--bar_hatchstyles
BAR_HATCHSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim
XLIM] [--ylim YLIM] [--grid] [--label_rotation LABEL_ROTATION] [--label_skip
LABEL_SKIP] [--force_freq FORCE_FREQ] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"bar" make a bar or column plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--bar_hatchstyles BAR_HATCHSTYLES
[optional, default to "auto", only used if type equal to "bar", "barh",
"bar_stacked", and "barh_stacked"]
If 'auto' will iterate through the available matplotlib hatch types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
┌─────────────────┬───────────────────┐
│ bar_hatchstyles │ Description │
╞═════════════════╪═══════════════════╡
│ / │ diagonal hatching │
├─────────────────┼───────────────────┤
│ \ │ back diagonal │
├─────────────────┼───────────────────┤
│ | │ vertical │
├─────────────────┼───────────────────┤
│ - │ horizontal │
├─────────────────┼───────────────────┤
│ + │ crossed │
├─────────────────┼───────────────────┤
│ x │ crossed diagonal │
├─────────────────┼───────────────────┤
│ o │ small circle │
├─────────────────┼───────────────────┤
│ O │ large circle │
├─────────────────┼───────────────────┤
│ . │ dots │
├─────────────────┼───────────────────┤
│ * │ stars │
╘═════════════════╧═══════════════════╛
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--label_rotation LABEL_ROTATION
[optional]
Rotation for major labels for bar plots.
--label_skip LABEL_SKIP
[optional]
Skip for major labels for bar plots.
--force_freq FORCE_FREQ
[optional, output format]
Force this frequency for the output. Typically you will only want to
enforce a smaller interval where toolbox_utils will insert missing
values as needed. WARNING: you may lose data if not careful with
this option. In general, letting the algorithm determine the
frequency should always work, but this option will override. Use
PANDAS offset codes.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
barh¶
$ plottoolbox barh --help
usage: plottoolbox barh [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--bar_hatchstyles
BAR_HATCHSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim
XLIM] [--ylim YLIM] [--grid] [--label_rotation LABEL_ROTATION] [--label_skip
LABEL_SKIP] [--force_freq FORCE_FREQ] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"barh" creates a horizontal bar plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--bar_hatchstyles BAR_HATCHSTYLES
[optional, default to "auto", only used if type equal to "bar", "barh",
"bar_stacked", and "barh_stacked"]
If 'auto' will iterate through the available matplotlib hatch types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
┌─────────────────┬───────────────────┐
│ bar_hatchstyles │ Description │
╞═════════════════╪═══════════════════╡
│ / │ diagonal hatching │
├─────────────────┼───────────────────┤
│ \ │ back diagonal │
├─────────────────┼───────────────────┤
│ | │ vertical │
├─────────────────┼───────────────────┤
│ - │ horizontal │
├─────────────────┼───────────────────┤
│ + │ crossed │
├─────────────────┼───────────────────┤
│ x │ crossed diagonal │
├─────────────────┼───────────────────┤
│ o │ small circle │
├─────────────────┼───────────────────┤
│ O │ large circle │
├─────────────────┼───────────────────┤
│ . │ dots │
├─────────────────┼───────────────────┤
│ * │ stars │
╘═════════════════╧═══════════════════╛
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--label_rotation LABEL_ROTATION
[optional]
Rotation for major labels for bar plots.
--label_skip LABEL_SKIP
[optional]
Skip for major labels for bar plots.
--force_freq FORCE_FREQ
[optional, output format]
Force this frequency for the output. Typically you will only want to
enforce a smaller interval where toolbox_utils will insert missing
values as needed. WARNING: you may lose data if not careful with
this option. In general, letting the algorithm determine the
frequency should always work, but this option will override. Use
PANDAS offset codes.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
barh_stacked¶
$ plottoolbox barh_stacked --help
usage: plottoolbox barh_stacked [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--bar_hatchstyles
BAR_HATCHSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim
XLIM] [--ylim YLIM] [--grid] [--label_rotation LABEL_ROTATION] [--label_skip
LABEL_SKIP] [--force_freq FORCE_FREQ] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"barh_stacked" makes a horizontal stacked bar plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--bar_hatchstyles BAR_HATCHSTYLES
[optional, default to "auto", only used if type equal to "bar", "barh",
"bar_stacked", and "barh_stacked"]
If 'auto' will iterate through the available matplotlib hatch types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
┌─────────────────┬───────────────────┐
│ bar_hatchstyles │ Description │
╞═════════════════╪═══════════════════╡
│ / │ diagonal hatching │
├─────────────────┼───────────────────┤
│ \ │ back diagonal │
├─────────────────┼───────────────────┤
│ | │ vertical │
├─────────────────┼───────────────────┤
│ - │ horizontal │
├─────────────────┼───────────────────┤
│ + │ crossed │
├─────────────────┼───────────────────┤
│ x │ crossed diagonal │
├─────────────────┼───────────────────┤
│ o │ small circle │
├─────────────────┼───────────────────┤
│ O │ large circle │
├─────────────────┼───────────────────┤
│ . │ dots │
├─────────────────┼───────────────────┤
│ * │ stars │
╘═════════════════╧═══════════════════╛
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--label_rotation LABEL_ROTATION
[optional]
Rotation for major labels for bar plots.
--label_skip LABEL_SKIP
[optional]
Skip for major labels for bar plots.
--force_freq FORCE_FREQ
[optional, output format]
Force this frequency for the output. Typically you will only want to
enforce a smaller interval where toolbox_utils will insert missing
values as needed. WARNING: you may lose data if not careful with
this option. In general, letting the algorithm determine the
frequency should always work, but this option will override. Use
PANDAS offset codes.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
bar_stacked¶
$ plottoolbox bar_stacked --help
usage: plottoolbox bar_stacked [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--bar_hatchstyles
BAR_HATCHSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim
XLIM] [--ylim YLIM] [--grid] [--label_rotation LABEL_ROTATION] [--label_skip
LABEL_SKIP] [--force_freq FORCE_FREQ] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"barh_stacked" creates a horizontal stacked bar plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--bar_hatchstyles BAR_HATCHSTYLES
[optional, default to "auto", only used if type equal to "bar", "barh",
"bar_stacked", and "barh_stacked"]
If 'auto' will iterate through the available matplotlib hatch types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
┌─────────────────┬───────────────────┐
│ bar_hatchstyles │ Description │
╞═════════════════╪═══════════════════╡
│ / │ diagonal hatching │
├─────────────────┼───────────────────┤
│ \ │ back diagonal │
├─────────────────┼───────────────────┤
│ | │ vertical │
├─────────────────┼───────────────────┤
│ - │ horizontal │
├─────────────────┼───────────────────┤
│ + │ crossed │
├─────────────────┼───────────────────┤
│ x │ crossed diagonal │
├─────────────────┼───────────────────┤
│ o │ small circle │
├─────────────────┼───────────────────┤
│ O │ large circle │
├─────────────────┼───────────────────┤
│ . │ dots │
├─────────────────┼───────────────────┤
│ * │ stars │
╘═════════════════╧═══════════════════╛
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--label_rotation LABEL_ROTATION
[optional]
Rotation for major labels for bar plots.
--label_skip LABEL_SKIP
[optional]
Skip for major labels for bar plots.
--force_freq FORCE_FREQ
[optional, output format]
Force this frequency for the output. Typically you will only want to
enforce a smaller interval where toolbox_utils will insert missing
values as needed. WARNING: you may lose data if not careful with
this option. In general, letting the algorithm determine the
frequency should always work, but this option will override. Use
PANDAS offset codes.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
bootstrap¶
$ plottoolbox bootstrap --help
<string>:375: (WARNING/2) Option list ends without a blank line; unexpected unindent.
<string>:377: (ERROR/3) Unexpected indentation.
<string>:384: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
usage: plottoolbox bootstrap [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--bootstrap_size BOOTSTRAP_SIZE] [--bootstrap_samples BOOTSTRAP_SAMPLES]
[--grid] [--por] [--invert_xaxis] [--invert_yaxis] [--round_index
ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y]
[--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors
HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X]
[--vlines_ymin VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors
VLINES_COLORS] [--vlines_linestyles VLINES_LINESTYLES]
"bootstrap" creates a plot that visually assess aspects of a data set by
plotting random selections of values. Only available for a single time-series.
Data must be organized as 'index,y1'. Can only plot one series.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--bootstrap_size BOOTSTRAP_SIZE
Defaults to 50.
The size of the bootstrap.
--bootstrap_samples BOOTSTRAP_SAMPLES
Defaults to 500.
The number of samples in the bootstrap.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
Option list ends without a blank line; unexpected unindent.
--dropna DROPNA --source_units SOURCE_UNITS
Unexpected indentation.
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must match
exactly.
Any unit string compatible with the 'pint' library can be used.
Block quote ends without a blank line; unexpected unindent.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
boxplot¶
$ plottoolbox boxplot --help
usage: plottoolbox boxplot [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid] [--por]
[--invert_xaxis] [--invert_yaxis] [--round_index ROUND_INDEX] [--dropna
DROPNA] [--source_units SOURCE_UNITS] [--target_units TARGET_UNITS]
[--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin
HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
Box extends from lower to upper quartile, with line at the median. Depending on
the statistics, the wiskers represent the range of the data or 1.5 times the
inter-quartile range (Q3 - Q1).
Data must be organized as 'index,y1,y2,y3,...,yN'. The 'index' is
ignored and all data columns are plotted. The "columns" keyword can be used to
duplicate or change the order of all the data columns.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
double_mass¶
$ plottoolbox double_mass --help
usage: plottoolbox double_mass [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS]
[--target_units TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y
HLINES_Y] [--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX]
[--hlines_colors HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES]
[--vlines_x VLINES_X] [--vlines_ymin VLINES_YMIN] [--vlines_ymax
VLINES_YMAX] [--vlines_colors VLINES_COLORS] [--vlines_linestyles
VLINES_LINESTYLES]
"double_mass" creates a 'x,y' plot of the cumulative sum of x and y.
If the input 'x,y' dataset(s) is organized as
'index,x1,y1,x2,y2,x3,y3,...,xN,yN' then the 'index' is ignored. If there is
one 'x,y' dataset then it can be organized as 'index,y' where 'index' is
used for 'x'. The "columns" keyword can be used to duplicate or change the
order of all the data columns.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
handh¶
$ plottoolbox handh --help
usage: plottoolbox handh [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--subplots] [--sharex]
[--sharey] [--colors COLORS] [--linestyles LINESTYLES] [--markerstyles
MARKERSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM]
[--ylim YLIM] [--secondary_y] [--mark_right] [--grid] [--drawstyle
DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis] [--round_index
ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y]
[--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors
HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X]
[--vlines_ymin VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors
VLINES_COLORS] [--vlines_linestyles VLINES_LINESTYLES]
"handh" creates a time series plot of a hydrograph (flow) and hyetograph
(precipitation).
Data must be organized as 'index,Q,P'. The 'index' must be a date/time and all
data columns are plotted. Legend names are taken from the column names in the
first row unless over-ridden by the legend_names keyword.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--subplots
[optional, defaults to False]
Make separate subplots for each time series.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--secondary_y
[optional, default is False]
• list/tuple: Give the column numbers or names to plot on secondary
y-axis.
• (string, string): The first string is the units of the primary axis,
the second string is the units of the secondary axis if you want
just unit conversion. Use any units or combination thereof from
the "pint" library.
• (callable, callable): Functions relating relationship between primary
and secondary axis. First function will be given the values on
primary axis and returns values on secondary axis. Second
function will be do the inverse. Python API only.
• string: One of pre-built (callable, callable) combinations. Can be one
of "period".
--mark_right
[optional, default is True]
When using a secondary_y axis, should the legend label the axis of the
various time-series automatically.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
heatmap¶
$ plottoolbox heatmap --help
usage: plottoolbox heatmap [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--grid] [--por] [--invert_xaxis] [--invert_yaxis] [--round_index
ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y]
[--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors
HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X]
[--vlines_ymin VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors
VLINES_COLORS] [--vlines_linestyles VLINES_LINESTYLES]
"heatmap" creates a 2D heatmap of daily data, day of year x-axis, and year for
y-axis. Only available for a single, daily time-series.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
hexbin¶
$ plottoolbox hexbin --help
usage: plottoolbox hexbin [-h] [--input_ts INPUT_TS]
[--reduce_C_function REDUCE_C_FUNCTION] [--gridsize GRIDSIZE] [--columns
COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--por]
[--invert_xaxis] [--invert_yaxis] [--source_units SOURCE_UNITS]
[--target_units TARGET_UNITS] [--plot_styles PLOT_STYLES]
Only available for a single x,y pair with an additional, optional data column.
If the data column is not provided, the number of points in each bin is shown.
If the data column is provided, the reduce_C_function is applied to all values
within each hexagon cell.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--reduce_C_function REDUCE_C_FUNCTION
Function of one argument that reduces all the values in a bin to a single
number. The available options at the command line are "np.mean",
"np.max", "np.sum", "np.std". Using the Python API can use any
callable.
--gridsize GRIDSIZE
The number of hexagons in the x-direction. The corresponding number of
hexagons in the y-direction is chosen in a way that the hexagons are
approximately regular. Alternatively, gridsize can be a tuple with
two elements specifying the number of hexagons in the x-direction
and the y-direction.
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
histogram¶
$ plottoolbox histogram --help
usage: plottoolbox histogram [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--sharex] [--sharey]
[--colors COLORS] [--linestyles LINESTYLES] [--markerstyles MARKERSTYLES]
[--style STYLE] [--grid] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS]
[--target_units TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y
HLINES_Y] [--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX]
[--hlines_colors HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES]
[--vlines_x VLINES_X] [--vlines_ymin VLINES_YMIN] [--vlines_ymax
VLINES_YMAX] [--vlines_colors VLINES_COLORS] [--vlines_linestyles
VLINES_LINESTYLES]
"histogram" will calculate and create a histogram plot. See 'kde' for a smooth
representation of a histogram.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
kde¶
$ plottoolbox kde --help
usage: plottoolbox kde [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--subplots] [--sharex]
[--sharey] [--colors COLORS] [--linestyles LINESTYLES] [--markerstyles
MARKERSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM]
[--ylim YLIM] [--secondary_y] [--grid] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"kde" will create a plot of estimation of the probability density function based
on the data called kernel density estimation (KDE).
Data must be organized as 'index,y1,y2,y3,...,yN'. The 'index' is
ignored and all data columns are plotted. The "columns" keyword can be used to
duplicate or change the order of all the data columns.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--subplots
[optional, defaults to False]
Make separate subplots for each time series.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--secondary_y
[optional, default is False]
• list/tuple: Give the column numbers or names to plot on secondary
y-axis.
• (string, string): The first string is the units of the primary axis,
the second string is the units of the secondary axis if you want
just unit conversion. Use any units or combination thereof from
the "pint" library.
• (callable, callable): Functions relating relationship between primary
and secondary axis. First function will be given the values on
primary axis and returns values on secondary axis. Second
function will be do the inverse. Python API only.
• string: One of pre-built (callable, callable) combinations. Can be one
of "period".
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
kde_time¶
$ plottoolbox kde_time --help
usage: plottoolbox kde_time [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--subplots] [--sharex]
[--sharey] [--colors COLORS] [--linestyles LINESTYLES] [--markerstyles
MARKERSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM]
[--ylim YLIM] [--secondary_y] [--mark_right] [--grid] [--drawstyle
DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis] [--round_index
ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y]
[--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors
HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X]
[--vlines_ymin VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors
VLINES_COLORS] [--vlines_linestyles VLINES_LINESTYLES]
This plot is an estimation of the probability density function based on the data
called kernel density estimation (KDE) combined with a time-series plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--subplots
[optional, defaults to False]
Make separate subplots for each time series.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--secondary_y
[optional, default is False]
• list/tuple: Give the column numbers or names to plot on secondary
y-axis.
• (string, string): The first string is the units of the primary axis,
the second string is the units of the secondary axis if you want
just unit conversion. Use any units or combination thereof from
the "pint" library.
• (callable, callable): Functions relating relationship between primary
and secondary axis. First function will be given the values on
primary axis and returns values on secondary axis. Second
function will be do the inverse. Python API only.
• string: One of pre-built (callable, callable) combinations. Can be one
of "period".
--mark_right
[optional, default is True]
When using a secondary_y axis, should the legend label the axis of the
various time-series automatically.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
lag_plot¶
$ plottoolbox lag_plot --help
usage: plottoolbox lag_plot [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--grid] [--por] [--invert_xaxis] [--invert_yaxis] [--round_index
ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS] [--target_units
TARGET_UNITS] [--lag_plot_lag LAG_PLOT_LAG] [--plot_styles PLOT_STYLES]
[--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN] [--hlines_xmax
HLINES_XMAX] [--hlines_colors HLINES_COLORS] [--hlines_linestyles
HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin VLINES_YMIN]
[--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"lag_plot" indicates structure in the data.
Data must be organized as 'index,y1'. Can only plot one series.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--lag_plot_lag LAG_PLOT_LAG
Defaults to 1.
The lag used in the plot.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
lognorm_xaxis¶
$ plottoolbox lognorm_xaxis --help
<string>:396: (WARNING/2) Option list ends without a blank line; unexpected unindent.
<string>:398: (ERROR/3) Unexpected indentation.
<string>:442: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
usage: plottoolbox lognorm_xaxis [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"lognorm_yaxis" will sort, calculate probabilities, and plot data against a y
axis lognormal distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
Option list ends without a blank line; unexpected unindent.
--dropna DROPNA --plotting_position PLOTTING_POSITION
Unexpected indentation.
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number of
values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
Block quote ends without a blank line; unexpected unindent.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
lognorm_yaxis¶
$ plottoolbox lognorm_yaxis --help
usage: plottoolbox lognorm_yaxis [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"lognorm_yaxis" will sort, calculate probabilities, and plot data against an y
axis lognormal distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--plotting_position PLOTTING_POSITION
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number
of values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
norm_xaxis¶
$ plottoolbox norm_xaxis --help
usage: plottoolbox norm_xaxis [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"norm_xaxis" will sort, calculate probabilities, and plot data against an x axis
normal distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--plotting_position PLOTTING_POSITION
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number
of values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
norm_yaxis¶
$ plottoolbox norm_yaxis --help
usage: plottoolbox norm_yaxis [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"norm_yaxis" will sort, calculate probabilities, and plot data against an y axis
normal distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--plotting_position PLOTTING_POSITION
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number
of values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
probability_density¶
$ plottoolbox probability_density --help
usage: plottoolbox probability_density [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--subplots]
[--sharex] [--sharey] [--colors COLORS] [--linestyles LINESTYLES]
[--markerstyles MARKERSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis
YAXIS] [--xlim XLIM] [--ylim YLIM] [--secondary_y] [--grid] [--por]
[--invert_xaxis] [--invert_yaxis] [--round_index ROUND_INDEX] [--dropna
DROPNA] [--source_units SOURCE_UNITS] [--target_units TARGET_UNITS]
[--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin
HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
Probability plot.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--subplots
[optional, defaults to False]
Make separate subplots for each time series.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--secondary_y
[optional, default is False]
• list/tuple: Give the column numbers or names to plot on secondary
y-axis.
• (string, string): The first string is the units of the primary axis,
the second string is the units of the secondary axis if you want
just unit conversion. Use any units or combination thereof from
the "pint" library.
• (callable, callable): Functions relating relationship between primary
and secondary axis. First function will be given the values on
primary axis and returns values on secondary axis. Second
function will be do the inverse. Python API only.
• string: One of pre-built (callable, callable) combinations. Can be one
of "period".
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
scatter_matrix¶
$ plottoolbox scatter_matrix --help
usage: plottoolbox scatter_matrix [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--scatter_matrix_diagonal SCATTER_MATRIX_DIAGONAL] [--grid] [--por]
[--invert_xaxis] [--invert_yaxis] [--round_index ROUND_INDEX] [--dropna
DROPNA] [--source_units SOURCE_UNITS] [--target_units TARGET_UNITS]
[--plot_styles PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin
HLINES_XMIN] [--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"scatter_matrix" will plots all columns against each other in a matrix, with the
diagonal plots either histogram or KDE probability distribution depending on
scatter_matrix_diagonal keyword.
Data must be organized as 'index,y1,y2,y3,...,yN'. The 'index' is
ignored and all data columns are plotted. The "columns" keyword can be used to
duplicate or change the order of all the data columns.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--scatter_matrix_diagonal SCATTER_MATRIX_DIAGONAL
[optional, defaults to "kde"]
What to plot on the diagonal of the scatter matrix.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
target¶
$ plottoolbox target --help
<string>:348: (WARNING/2) Option list ends without a blank line; unexpected unindent.
<string>:350: (ERROR/3) Unexpected indentation.
<string>:357: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
usage: plottoolbox target [-h] [--obs_col OBS_COL] [--sim_col SIM_COL]
[--input_ts INPUT_TS] [--columns COLUMNS] [--start_date START_DATE]
[--end_date END_DATE] [--clean] [--skiprows SKIPROWS] [--index_type
INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME] [--title TITLE]
[--figsize FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES]
[--colors COLORS] [--linestyles LINESTYLES] [--markerstyles MARKERSTYLES]
[--style STYLE] [--por] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES]
"target" creates a target diagram that compares three goodness of fit statistics
on one plot. The three goodness of fit statistics calculated and displayed are
bias, root mean square deviation, and centered root mean square deviation. The
data columns have to be organized as 'observed,simulated1,simulated2,simulated3-
,...etc.'
options:
-h | --help
show this help message and exit
--obs_col OBS_COL
If integer represents the column number of standard input. Can be If
integer represents the column number of standard input. Can be a
csv, wdm, hdf or xlsx file following format specified in 'tstoolbox
read ...'.
--sim_col SIM_COL
If integer represents the column number of standard input. Can be a csv,
wdm, hdf or xlsx file following format specified in 'tstoolbox read
...'.
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
Option list ends without a blank line; unexpected unindent.
--dropna DROPNA --source_units SOURCE_UNITS
Unexpected indentation.
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must match
exactly.
Any unit string compatible with the 'pint' library can be used.
Block quote ends without a blank line; unexpected unindent.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
taylor¶
$ plottoolbox taylor --help
usage: plottoolbox taylor [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--title TITLE] [--figsize FIGSIZE] [--legend LEGEND] [--legend_names
LEGEND_NAMES] [--colors COLORS] [--linestyles LINESTYLES] [--markerstyles
MARKERSTYLES] [--style STYLE] [--por] [--round_index ROUND_INDEX] [--dropna
DROPNA] [--source_units SOURCE_UNITS] [--target_units TARGET_UNITS]
[--plot_styles PLOT_STYLES]
"taylor" will create a taylor diagram that compares three goodness of fit
statistics on one plot. The three goodness of fit statistics calculated and
displayed are standard deviation, correlation coefficient, and centered root
mean square deviation. The data columns have to be organized as
'observed,simulated1,simulated2,simulated3,...etc.'
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
time¶
$ plottoolbox time --help
usage: plottoolbox time [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--subplots] [--sharex]
[--sharey] [--colors COLORS] [--linestyles LINESTYLES] [--markerstyles
MARKERSTYLES] [--style STYLE] [--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM]
[--ylim YLIM] [--secondary_y SECONDARY_Y] [--mark_right] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--source_units SOURCE_UNITS]
[--target_units TARGET_UNITS] [--plot_styles PLOT_STYLES] [--hlines_y
HLINES_Y] [--hlines_xmin HLINES_XMIN] [--hlines_xmax HLINES_XMAX]
[--hlines_colors HLINES_COLORS] [--hlines_linestyles HLINES_LINESTYLES]
[--vlines_x VLINES_X] [--vlines_ymin VLINES_YMIN] [--vlines_ymax
VLINES_YMAX] [--vlines_colors VLINES_COLORS] [--vlines_linestyles
VLINES_LINESTYLES]
"time" creates a standard time series plot.
Data must be organized as 'index,y1,y2,y3,...,yN'. The 'index' must be a
date/time and all data columns are plotted. Legend names are taken from the
column names in the first row unless over-ridden by the legend_names keyword.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--subplots
[optional, defaults to False]
Make separate subplots for each time series.
--sharex
[optional, default to True]
In case subplots=True, share x axis.
--sharey
[optional, default to False]
In case subplots=True, share y axis.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--secondary_y SECONDARY_Y
[optional, default is False]
• list/tuple: Give the column numbers or names to plot on secondary
y-axis.
• (string, string): The first string is the units of the primary axis,
the second string is the units of the secondary axis if you want
just unit conversion. Use any units or combination thereof from
the "pint" library.
• (callable, callable): Functions relating relationship between primary
and secondary axis. First function will be given the values on
primary axis and returns values on secondary axis. Second
function will be do the inverse. Python API only.
• string: One of pre-built (callable, callable) combinations. Can be one
of "period".
--mark_right
[optional, default is True]
When using a secondary_y axis, should the legend label the axis of the
various time-series automatically.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
waterfall¶
$ plottoolbox waterfall --help
<string>:396: (WARNING/2) Option list ends without a blank line; unexpected unindent.
<string>:400: (ERROR/3) Unexpected indentation.
<string>:407: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
usage: plottoolbox waterfall [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
Create a waterfall plot from a time series.
Data must be organized as 'index,y1,y2,y3,...,yN'. The 'index' must be a
date/time and all data columns are plotted. Legend names are taken from the
column names in the first row unless over-ridden by the legend_names keyword.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
Option list ends without a blank line; unexpected unindent.
--dropna DROPNA --plotting_position PLOTTING_POSITION --prob_plot_sort_values
PROB_PLOT_SORT_VALUES --source_units SOURCE_UNITS
Unexpected indentation.
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must match
exactly.
Any unit string compatible with the 'pint' library can be used.
Block quote ends without a blank line; unexpected unindent.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
weibull_xaxis¶
$ plottoolbox weibull_xaxis --help
usage: plottoolbox weibull_xaxis [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"weibull_xaxis" will sort, calculate and plot data against an y axis weibull
distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--plotting_position PLOTTING_POSITION
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number
of values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
weibull_yaxis¶
$ plottoolbox weibull_yaxis --help
usage: plottoolbox weibull_yaxis [-h] [--input_ts INPUT_TS]
[--columns COLUMNS] [--start_date START_DATE] [--end_date END_DATE] [--clean]
[--skiprows SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename
OFILENAME] [--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize
FIGSIZE] [--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--grid]
[--drawstyle DRAWSTYLE] [--por] [--invert_xaxis] [--invert_yaxis]
[--round_index ROUND_INDEX] [--dropna DROPNA] [--plotting_position
PLOTTING_POSITION] [--prob_plot_sort_values PROB_PLOT_SORT_VALUES]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
"weibull_yaxis" will sort, calculate and plot data against an y axis weibull
distribution.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--plotting_position PLOTTING_POSITION
[optional, default is 'weibull']
┌────────────┬────────┬──────────────────────┬────────────────────┐
│ Name │ a │ Equation (i-a)/(n+1- │ Description │
│ │ │ -2*a) │ │
╞════════════╪════════╪══════════════════════╪════════════════════╡
│ weibull │ 0 │ i/(n+1) │ mean of sampling │
│ (default) │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ filliben │ 0.3175 │ (i-0.3175)/(n+0.365) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ yu │ 0.326 │ (i-0.326)/(n+0.348) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ tukey │ 1/3 │ (i-1/3)/(n+1/3) │ approx. median of │
│ │ │ │ sampling distribu- │
│ │ │ │ tion │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ blom │ 0.375 │ (i-0.375)/(n+0.25) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ cunnane │ 2/5 │ (i-2/5)/(n+1/5) │ subjective │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gringorton │ 0.44 │ (1-0.44)/(n+0.12) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ hazen │ 1/2 │ (i-1/2)/n │ midpoints of n │
│ │ │ │ equal intervals │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ larsen │ 0.567 │ (i-0.567)/(n-0.134) │ │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ gumbel │ 1 │ (i-1)/(n-1) │ mode of sampling │
│ │ │ │ distribution │
├────────────┼────────┼──────────────────────┼────────────────────┤
│ california │ NA │ i/n │ │
╘════════════╧════════╧══════════════════════╧════════════════════╛
Where 'i' is the sorted rank of the y value, and 'n' is the total number
of values to be plotted.
The 'blom' plotting position is also known as the 'Sevruk and Geiger'.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--prob_plot_sort_values PROB_PLOT_SORT_VALUES
[optional, default is 'descending']
How to sort the values for the probability plots.
Only used for norm_xaxis, norm_yaxis, lognorm_xaxis, lognorm_yaxis,
weibull_xaxis, and weibull_yaxis.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.
xy¶
$ plottoolbox xy --help
usage: plottoolbox xy [-h] [--input_ts INPUT_TS] [--columns COLUMNS]
[--start_date START_DATE] [--end_date END_DATE] [--clean] [--skiprows
SKIPROWS] [--index_type INDEX_TYPE] [--names NAMES] [--ofilename OFILENAME]
[--xtitle XTITLE] [--ytitle YTITLE] [--title TITLE] [--figsize FIGSIZE]
[--legend LEGEND] [--legend_names LEGEND_NAMES] [--colors COLORS]
[--linestyles LINESTYLES] [--markerstyles MARKERSTYLES] [--style STYLE]
[--xaxis XAXIS] [--yaxis YAXIS] [--xlim XLIM] [--ylim YLIM] [--xy_match_line
XY_MATCH_LINE] [--grid] [--drawstyle DRAWSTYLE] [--por] [--invert_xaxis]
[--invert_yaxis] [--round_index ROUND_INDEX] [--dropna DROPNA]
[--source_units SOURCE_UNITS] [--target_units TARGET_UNITS] [--plot_styles
PLOT_STYLES] [--hlines_y HLINES_Y] [--hlines_xmin HLINES_XMIN]
[--hlines_xmax HLINES_XMAX] [--hlines_colors HLINES_COLORS]
[--hlines_linestyles HLINES_LINESTYLES] [--vlines_x VLINES_X] [--vlines_ymin
VLINES_YMIN] [--vlines_ymax VLINES_YMAX] [--vlines_colors VLINES_COLORS]
[--vlines_linestyles VLINES_LINESTYLES]
If the input 'x,y' dataset(s) is organized as
'index,x1,y1,x2,y2,x3,y3,...,xN,yN' then the 'index' is ignored. If there is
one 'x,y' dataset then it can be organized as 'index,y' where 'index' is
used for 'x'. The "columns" keyword can be used to duplicate or change the
order of all the data columns.
options:
-h | --help
show this help message and exit
--input_ts INPUT_TS
[optional though required if using within Python, default is '-' (stdin)]
Whether from a file or standard input, data requires a single line header
of column names. The default header is the first line of the input,
but this can be changed for CSV files using the 'skiprows' option.
Most common date formats can be used, but the closer to ISO 8601 date/time
standard the better.
Comma-separated values (CSV) files or tab-separated values (TSV):
File separators will be automatically detected.
Columns can be selected by name or index, where the index for
data columns starts at 1.
Command line examples:
┌─────────────────────────────────┬───────────────────────────┐
│ Keyword Example │ Description │
╞═════════════════════════════════╪═══════════════════════════╡
│ --input_ts=fn.csv │ read all columns from │
│ │ 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,1 │ read data columns 2 and 1 │
│ │ from 'fn.csv' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.csv,2,skiprows=2 │ read data column 2 from │
│ │ 'fn.csv', skipping first │
│ │ 2 rows so header is read │
│ │ from third row │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.xlsx,2,Sheet21 │ read all data from 2nd │
│ │ sheet all data from │
│ │ "Sheet21" of 'fn.xlsx' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.hdf5,Table12,T2 │ read all data from table │
│ │ "Table12" then all data │
│ │ from table "T2" of │
│ │ 'fn.hdf5' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts=fn.wdm,210,110 │ read DSNs 210, then 110 │
│ │ from 'fn.wdm' │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' │ read all columns from │
│ │ standard input (stdin) │
├─────────────────────────────────┼───────────────────────────┤
│ --input_ts='-' --columns=4,1 │ read column 4 and 1 from │
│ │ standard input (stdin) │
╘═════════════════════════════════╧═══════════════════════════╛
If working with CSV or TSV files you can use redirection rather than use
--input_ts=fname.csv. The following are identical:
From a file:
command subcmd --input_ts=fname.csv
From standard input (since '--input_ts=-' is the default:
command subcmd < fname.csv
Can also combine commands by piping:
command subcmd < filein.csv | command subcmd1 > fileout.csv
Python library examples:
You must use the `input_ts=...` option where `input_ts` can be
one of a [pandas DataFrame, pandas Series, dict, tuple, list,
StringIO, or file name].
--columns COLUMNS
[optional, defaults to all columns, input filter]
Columns to select out of input. Can use column names from the first line
header or column numbers. If using numbers, column number 1 is the
first data column. To pick multiple columns; separate by commas with
no spaces. As used in toolbox_utils pick command.
This solves a big problem so that you don't have to create a data set with
a certain column order, you can rearrange columns when data is read
in.
--start_date START_DATE
[optional, defaults to first date in time-series, input filter]
The start_date of the series in ISOdatetime format, or 'None' for
beginning.
--end_date END_DATE
[optional, defaults to last date in time-series, input filter]
The end_date of the series in ISOdatetime format, or 'None' for end.
--clean
[optional, default is False, input filter]
The 'clean' command will repair a input index, removing duplicate index
values and sorting.
--skiprows SKIPROWS
[optional, default is None which will infer header from first line, input
filter]
Line numbers to skip (0-indexed) if a list or number of lines to skip at
the start of the file if an integer.
If used in Python can be a callable, the callable function will be
evaluated against the row indices, returning True if the row should
be skipped and False otherwise. An example of a valid callable
argument would be
lambda x: x in [0, 2].
--index_type INDEX_TYPE
[optional, default is 'datetime', output format]
Can be either 'number' or 'datetime'. Use 'number' with index values that
are Julian dates, or other epoch reference.
--names NAMES
[optional, default is None, transformation]
If None, the column names are taken from the first row after 'skiprows'
from the input dataset.
MUST include a name for all columns in the input dataset, including the
index column.
--ofilename OFILENAME
[optional, defaults to 'plot.png']
Output filename for the plot. Extension defines the type, for example
'filename.png' will create a PNG file.
If used within Python, and ofilename is None will return the Matplotlib
figure that can then be changed or added to as needed.
--xtitle XTITLE
[optional, default depends on type]
Title of x-axis.
--ytitle YTITLE
[optional, default depends on type]
Title of y-axis.
--title TITLE
[optional, defaults to '']
Title of chart.
--figsize FIGSIZE
[optional, defaults to '10,6.5']
The 'width,height' of plot in inches.
--legend LEGEND
[optional, default is True]
Whether to create a legend or not.
--legend_names LEGEND_NAMES
[optional, default is None]
If the default of None will take legend names from columns tiles in the
input dataset. Otherwise will take names from the legend_names list.
--colors COLORS
[optional, default is 'auto']
The default 'auto' will cycle through matplotlib colors in the chosen
style.
At the command line supply a comma separated matplotlib color codes, or
within Python a list of color code strings.
Can identify colors in four different ways.
1. Use 'CN' where N is a number from 0 to 9 that gets the Nth color from
the current style.
2. Single character code from the table below.
┌──────┬─────────┐
│ Code │ Color │
╞══════╪═════════╡
│ b │ blue │
├──────┼─────────┤
│ g │ green │
├──────┼─────────┤
│ r │ red │
├──────┼─────────┤
│ c │ cyan │
├──────┼─────────┤
│ m │ magenta │
├──────┼─────────┤
│ y │ yellow │
├──────┼─────────┤
│ k │ black │
╘══════╧═════════╛
3. Number between 0 and 1 that represents the level of gray, where 0 is
white an 1 is black.
4. Any of the HTML color names.
┌──────────────────┐
│ HTML Color Names │
╞══════════════════╡
│ red │
├──────────────────┤
│ burlywood │
├──────────────────┤
│ chartreuse │
├──────────────────┤
│ ...etc. │
╘══════════════════╛
Color reference: <[4;36mhttp://matplotlib.org/api/colors_api.html[0m>
--linestyles LINESTYLES
[optional, default to 'auto']
If 'auto' will iterate through the available matplotlib line types.
Otherwise on the command line a comma separated list, or a list of
strings if using the Python API.
To not display lines use a space (' ') as the linestyle code.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌─────────┬──────────────┐
│ Code │ Lines │
╞═════════╪══════════════╡
│ - │ solid │
├─────────┼──────────────┤
│ -- │ dashed │
├─────────┼──────────────┤
│ -. │ dash_dot │
├─────────┼──────────────┤
│ : │ dotted │
├─────────┼──────────────┤
│ None │ draw nothing │
├─────────┼──────────────┤
│ ' ' │ draw nothing │
├─────────┼──────────────┤
│ '' │ draw nothing │
╘═════════╧══════════════╛
Line reference: <[4;36mhttp://matplotlib.org/api/artist_api.html[0m>
--markerstyles MARKERSTYLES
[optional, default to ' ']
The default ' ' will not plot a marker. If 'auto' will iterate through the
available matplotlib marker types. Otherwise on the command line a
comma separated list, or a list of strings if using the Python API.
Separated 'colors', 'linestyles', and 'markerstyles' instead of using the
'style' keyword.
┌───────┬────────────────┐
│ Code │ Markers │
╞═══════╪════════════════╡
│ . │ point │
├───────┼────────────────┤
│ o │ circle │
├───────┼────────────────┤
│ v │ triangle down │
├───────┼────────────────┤
│ ^ │ triangle up │
├───────┼────────────────┤
│ < │ triangle left │
├───────┼────────────────┤
│ > │ triangle right │
├───────┼────────────────┤
│ 1 │ tri_down │
├───────┼────────────────┤
│ 2 │ tri_up │
├───────┼────────────────┤
│ 3 │ tri_left │
├───────┼────────────────┤
│ 4 │ tri_right │
├───────┼────────────────┤
│ 8 │ octagon │
├───────┼────────────────┤
│ s │ square │
├───────┼────────────────┤
│ p │ pentagon │
├───────┼────────────────┤
│ * │ star │
├───────┼────────────────┤
│ h │ hexagon1 │
├───────┼────────────────┤
│ H │ hexagon2 │
├───────┼────────────────┤
│ + │ plus │
├───────┼────────────────┤
│ x │ x │
├───────┼────────────────┤
│ D │ diamond │
├───────┼────────────────┤
│ d │ thin diamond │
├───────┼────────────────┤
│ _ │ hline │
├───────┼────────────────┤
│ None │ nothing │
├───────┼────────────────┤
│ ' ' │ nothing │
├───────┼────────────────┤
│ '' │ nothing │
╘═══════╧════════════════╛
Marker reference: <[4;36mhttp://matplotlib.org/api/markers_api.html[0m>
--style STYLE
[optional, default is None]
Still available, but if None is replaced by 'colors', 'linestyles', and
'markerstyles' options. Currently the 'style' option will override
the others.
Comma separated matplotlib style strings per time-series. Just combine
codes in 'ColorMarkerLine' order, for example 'r*--' is a red dashed
line with star marker.
--xaxis XAXIS
[optional, default is 'arithmetic']
Defines the type of the xaxis. One of 'arithmetic', 'log'.
--yaxis YAXIS
[optional, default is 'arithmetic']
Defines the type of the yaxis. One of 'arithmetic', 'log'.
--xlim XLIM
[optional, default is based on range of x values]
Comma separated lower and upper limits for the x-axis of the plot. For
example, '--xlim 1,1000' would limit the plot from 1 to 1000, where
'--xlim ,1000' would base the lower limit on the data and set the
upper limit to 1000.
--ylim YLIM
[optional, default is based on range of y values]
Comma separated lower and upper limits for the y-axis of the plot. See
xlim for examples.
--xy_match_line XY_MATCH_LINE
[optional, defaults to ""]
The style string to use to plot the xy match line.
--grid
[optional, default is False]
Whether to plot grid lines on the major ticks.
--drawstyle DRAWSTYLE
[optional, default is 'default']
'default' connects the points with lines. The steps variants produce
step-plots. 'steps' is equivalent to 'steps-pre' and is maintained
for backward-compatibility.
ACCEPTS:
['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']
--por
[optional]
Plot from first good value to last good value. Strips NANs from beginning
and end.
--invert_xaxis
[optional, default is False]
Invert the x-axis.
--invert_yaxis
[optional, default is False]
Invert the y-axis.
--round_index ROUND_INDEX
[optional, default is None which will do nothing to the index, output
format]
Round the index to the nearest time point. Can significantly improve the
performance since can cut down on memory and processing
requirements, however be cautious about rounding to a very course
interval from a small one. This could lead to duplicate values in
the index.
--dropna DROPNA
[optional, defauls it 'no', input filter]
Set dropna to 'any' to have records dropped that have NA value in any
column, or 'all' to have records dropped that have NA in all
columns. Set to 'no' to not drop any records. The default is 'no'.
--source_units SOURCE_UNITS
[optional, default is None, transformation]
If unit is specified for the column as the second field of a ':' delimited
column name, then the specified units and the 'source_units' must
match exactly.
Any unit string compatible with the 'pint' library can be used.
--target_units TARGET_UNITS
[optional, default is None, transformation]
The purpose of this option is to specify target units for unit conversion.
The source units are specified in the header line of the input or
using the 'source_units' keyword.
The units of the input time-series or values are specified as the second
field of a ':' delimited name in the header line of the input or in
the 'source_units' keyword.
Any unit string compatible with the 'pint' library can be used.
This option will also add the 'target_units' string to the column names.
--plot_styles PLOT_STYLES
[optional, default is "default"]
Set the style of the plot. One or more of Matplotlib styles "classic",
"Solarize_Light2", "bmh", "dark_background", "fast",
"fivethirtyeight", "ggplot", "grayscale", "seaborn",
"seaborn-bright", "seaborn-colorblind", "seaborn-dark",
"seaborn-dark-palette", "seaborn-darkgrid", "seaborn-deep",
"seaborn-muted", "seaborn-notebook", "seaborn-paper",
"seaborn-pastel", "seaborn-poster", "seaborn-talk", "seaborn-ticks",
"seaborn-white", "seaborn-whitegrid", "tableau-colorblind10", and
The main SciencePlots styles are "science", "grid", "ieee", "scatter",
"notebook", "high-vis", "bright", "vibrant", "muted", and "retro".
Other SciencPlots styles that are less common or intended to modify other
styles are, "cjk-jp-font.mplstyle", "cjk-kr-font.mplstyle",
"cjk-sc-font.mplstyle", "cjk-tc-font.mplstyle",
"high-contrast.mplstyle", "latex-sans.mplstyle", "light.mplstyle",
"nature.mplstyle", "no-latex.mplstyle", "pgf.mplstyle",
"russian-font.mplstyle", and "std-colors.mplstyle".
If multiple styles then each over rides some or all of the characteristics
of the previous.
Color Blind Appropriate Styles
The styles "seaborn-colorblind", "tableau-colorblind10", "bright",
"vibrant", and "muted" are all styles that are setup to be able to
be distinguished by someone with color blindness.
Black, White, and Gray Styles
The "ieee" style is appropriate for black, white, and gray, however the
"ieee" also will change the chart size to fit in a column of the
"IEEE" journal.
The "grayscale" is another style useful for photo-copyable black, white,
nd gray.
Matplotlib styles: <[4;36mhttps://matplotlib.org/3.3.1/gallery/style_she-
ets/style_sheets_reference.html[0m>
SciencePlots styles: <[4;36mhttps://github.com/garrettj403/SciencePlots[0m>
--hlines_y HLINES_Y
[optional, defaults to None]
Number or list of y values where to place a horizontal line.
--hlines_xmin HLINES_XMIN
[optional, defaults to None]
List of minimum x values to start the horizontal line. If a list must be
same length as hlines_y. If a single number will be used as the
minimum x values for all horizontal lines. A missing value or None
will start at the minimum x value for the entire plot.
--hlines_xmax HLINES_XMAX
[optional, defaults to None]
List of maximum x values to end each horizontal line. If a list must be
same length as hlines_y. If a single number will be the maximum x
value for all horizontal lines. A missing value or None will end at
the maximum x value for the entire plot.
--hlines_colors HLINES_COLORS
[optional, defaults to None]
List of colors for the horizontal lines. If a single color then will be
used as the color for all horizontal lines. If a list must be same
length as hlines_y. If None will take from the color pallette in the
current plot style.
--hlines_linestyles HLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the horizontal lines. If a single linestyle then
will be used as the linestyle for all horizontal lines. If a list
must be same length as hlines_y. If None will take for the standard
linestyles list.
--vlines_x VLINES_X
[optional, defaults to None]
List of x values where to place a vertical line.
--vlines_ymin VLINES_YMIN
[optional, defaults to None]
List of minimum y values to start the vertical line. If a list must be
same length as vlines_x. If a single number will be used as the
minimum x values for all vertical lines. A missing value or None
will start at the minimum x value for the entire plot.
--vlines_ymax VLINES_YMAX
[optional, defaults to None]
List of maximum x values to end each vertical line. If a list must be same
length as vlines_x. If a single number will be the maximum x value
for all vertical lines. A missing value or None will end at the
maximum x value for the entire plot.
--vlines_colors VLINES_COLORS
[optional, defaults to None]
List of colors for the vertical lines. If a single color then will be used
as the color for all vertical lines. If a list must be same length
as vlines_x. If None will take from the color pallette in the
current plot style.
--vlines_linestyles VLINES_LINESTYLES
[optional, defaults to None]
List of linestyles for the vertical lines. If a single linestyle then will
be used as the linestyle for all vertical lines. If a list must be
same length as vlines_x. If None will take for the standard
linestyles list.