Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix backtick formatting.

  • Loading branch information...
commit bd0b6333f886c6ec385f0e1345862ecd8a012777 1 parent c534b03
@lmjohns3 authored
Showing with 23 additions and 21 deletions.
  1. +23 −21 README.rst
View
44 README.rst
@@ -6,11 +6,11 @@ A command-line tool for creating plots from data in text files.
Installation
------------
-With `pip`::
+With ``pip``::
pip install lmj.plot
-Or, clone this repository and put the plot script somewhere in your `PATH`::
+Or, clone this repository and put the plot script somewhere in your ``PATH``::
git clone http://github.com/lmjohns3/py-plot
cd py-plot
@@ -35,7 +35,8 @@ in a log file as the experiments run. Here's a snippet from an example log file:
All of those "training accuracy" lines hidden in there will give us a good idea
of how well the algorithm is performing. To get a quick plot of them::
- cat ~/Experiments/tagger-beam1.log | lmj-plot -m 'training accuracy: (\S+)'
+ cat ~/Experiments/tagger-beam1.log | lmj-plot -m \
+ 'training accuracy: (\S+)'
If you have your matplotlib configured with an interactive backend, you should
see a nice little plot appear.
@@ -58,24 +59,25 @@ values will be plotted on the ordinate, in data-file order. If you want explicit
control over the abscissa, just include another match group in your regular
expression::
- nl ~/Experiments/tagger-beam1.log | lmj-plot -m '^(\d+) .* training accuracy: (\S+)'
+ nl ~/Experiments/tagger-beam1.log | lmj-plot -m \
+ '^(\d+) .* training accuracy: (\S+)'
-(The `nl` utility numbers the lines of the input file.)
+(The ``nl`` utility numbers the lines of the input file.)
If you provide three match groups per line, the first is plotted along the
abscissa, the second along the ordinate, and the third gives the size of an
-error bar along the ordinate. Use the `--fill-error` flag to plot error regions
-using a shaded polygon instead of bars on the data points.
+error bar along the ordinate. Use the ``--fill-error`` flag to plot error
+regions using a shaded polygon instead of bars on the data points.
To get even more sophisticated, name your match groups to specify them in an
-alternate order. For instance, if your log file had `0.33 +/- 0.01` you could
+alternate order. For instance, if your log file had ``0.33 +/- 0.01`` you could
include error bars like so::
nl ~/Experiments/tagger-beam1.log | lmj-plot -m \
'^(?P<x>\d+) .* training accuracy: (?P<y>\S+) ... (?P<ey>\S+)'
-You can specify match groups for `x`, `y`, `ex` (error in the abscissa) and `ey`
-(error in the ordinate).
+You can specify match groups for ``x``, ``y``, ``ex`` (error in the abscissa)
+and ``ey`` (error in the ordinate).
Multiple series
~~~~~~~~~~~~~~~
@@ -92,30 +94,30 @@ Multiple series from one file
Alternatively, you can specify just one data file and multiple regular
expressions. For instance, let's say you have one log file that contains
-`training accuracy: XX` and `evaluation accuracy: XX` lines that you'd like to
-plot. You can grab these lines and put them in separate series on your plot::
+``training accuracy: XX`` and ``evaluation accuracy: XX`` lines that you'd like
+to plot. You can grab these lines and put them in separate series on your plot::
- py-grep-plot -m 'training accuracy: (\S+)' 'evaluation accuracy: (\S+)' \
+ lmj-plot -m 'training accuracy: (\S+)' 'evaluation accuracy: (\S+)' \
--input training.log
In this case, it's probably easier to pass input to the script using a shell
-redirection, because the `-m` option will slurp up anything that comes after it
-(that's not itself a flag).
+redirection, because the ``-m`` option will slurp up anything that comes after
+it (that's not itself a flag).
Smoothing
~~~~~~~~~
-You can smooth the ordinates by using either the `-s N` (`--smooth N`) or the
-`-b N` (`--batch N`) options. The `--smooth` option convolves a rectangular
-filter over the data values before plotting, which yields smoother curves but
-has edge effects. The `--batch` option groups the input data and plots just the
-mean and standard deviation of each group.
+You can smooth the ordinates by using either the ``-s N`` (``--smooth N``) or
+the ``-b N`` (``--batch N``) options. The ``--smooth`` option convolves a
+rectangular filter over the data values before plotting, which yields smoother
+curves but has edge effects. The ``--batch`` option groups the input data and
+plots just the mean and standard deviation of each group.
Other options
~~~~~~~~~~~~~
There are several other command-line options, including some basic controls for
-the plot colors and styles, X- and Y-axis limits; use `--help` to get an
+the plot colors and styles, X- and Y-axis limits; use ``--help`` to get an
overview.
License

0 comments on commit bd0b633

Please sign in to comment.
Something went wrong with that request. Please try again.