/plot-scripts

Quick plots directly in the terminal window

Primary LanguageR

Sometimes you just want a quick look at some data, without even having to leave your shell, well here you go. Under the hood R and library(txtplot) are used to generate the plots.

shuf -i1-100 -n20 | bin/plot-hist
      ++-------------+-------------+-------------+-------------+-------------+-+
0.011 +                                               ***                      +
      |                                            ***  ***                    |
      |                                           **      **                   |
      |                  ***                     **         *                  |
      |               **** ****                 **           *                 |
 0.01 +              **       **               **            **                +
      |             **          **           **               **               |
      |            **            **         **                 **              |
      |           **               **     ***                   *              |
0.009 +           *                 *******                     **             +
      |          **                                              *             |
      |         **                                                *            |
      |         *                                                 **           |
0.008 +        **                                                  *           +
      |       **                                                   **          |
      |       *                                                     *          |
      |      **                                                      *         |
      |      *                                                       **        |
0.007 +     **                                                        *        +
      |     *                                                         **       |
      |    *                                                           *       |
      |   **                                                            *      |
0.006 +   *                                                             **     +
      |  **                                                              *     |
      |  *                                                               **    |
      |                                                                   *    |
      |                                                                   **   |
0.005 ++-------------+-------------+-------------+-------------+-------------+-+
       0            20            40            60            80            100 
paste <(shuf -i1-100 -n20) <(shuf -i1-100 -n20) | bin/plot-scatter 
   ++----------+-----------+----------+----------+----------+--+
   |  *                                                        |
80 +                                               *           +
   |                            *                              |
   |                                                           |
   |             *                                             |
   |                                                           |
60 +                *                                          +
   |                                                  *        |
   |     *    *                                           *    |
   |                                                           |
   |                                                           |
40 +                                       *                   +
   |                                                           |
   |                                                           |
   |                                *     *                    |
   |                          *                                |
20 +                                                 *         +
   |                         *                    *            |
   |                                                           |
   |                                                    *      |
   |                       *                               *   |
 0 +                                  *                        +
   ++----------+-----------+----------+----------+----------+--+
    0         20          40         60         80         100