script_template_plot

Script template for plotting scripts.

Deprecated since version 1.6.0: Example deprivation warning. scripts.script_template_plot will be removed in MDTools 2.0.0. It is replaced by scripts.script_template_plot_new, because the latter has additional functionality xyz.

Todo

  • Example todo list.

  • Implement feature xyz.

The following is a guide/template on how to write a docstring for a MDTools script. For more information see the Developer’s guide and the NumPy docstring convention.

Scripts that create plots from the output of other scripts should have the same name as the script whose output is plotted, prefixed with plot_. For instance, a script that plots the output of a script with the name msd.py should have the name plot_msd.py. Suffixes that give further hints on what the script does are allowed, e.g. plot_msd_logscale.py.

The first part of the docstring should contain the following paragraphs (all separated by a blank line):

  1. One-sentence summary (preferably one line only).

  2. Potential deprecation warning.

  3. Potential todo list.

  4. Extended summary clarifying functionality, not implementation details or background theory (this goes in the Notes section).

Note that you will have to repeat parts of the docstring (especially the summary and a potentially abbreviated version of the Options section) when implementing the command-line interface with argparse.

Options

An reStructuredText option list listing all options with which the script can/must be called and their meaning.

-f

Input filename. The input file must be a text file with at least two columns of data.

-o

Output filename. The image file format is inferred from the extension. The extension .pdf is recommended and will usually result in scalable vector graphics.

--cols

The columns of the input file that should be plotted. The first given column is treated as x data, all other given columns are treated as y data. Column numbering starts at zero. Default: None (this means read all columns).

--labels

A label for each set of y data. The labels will be shown in the legend of the plot. If provided, you must give one label for each set of y data. Labels are assigned to the sets of y data by their input order. If you do not want to label a specific set of y data, parse None for this set. Default: None.

--xylabel

x- and y-axis label. Default: [r'$x$', r'$y$'].

--xlim

Left and right limit of the x-axis in data coordinates. Parse None to adjust the limit(s) automatically. Default: [None, None].

--ylim

Lower and upper limit of the y-axis in data coordinates. Parse None to adjust the limit(s) automatically. Default: [None, None].

--log

Whether to use a logarithmic scale for the x- and/or y-axis. Default: [False, False].

Output

Optional section containing for example a list of files which are created by the script.

Outfile (-o).pdf

A plot of y versus x as vector graphic in the portable document format (PDF).

See also

scripts.templates.script_template

Script template for scripts that process MD trajectories

scripts.templates.script_template_dtrj

Script template for scripts that process discrete trajectories

some_function()

A function that is not defined in this script, but which helps understanding the script’s output or what the script does

Notes

Implementation details and background theory.[1]

References

Examples

At least one particular use case of the script, optimally with a graph demonstrating how the plots that are produced by this script look like.