1

I'm trying to pick a plotting library to plot data in the terminal, in ASCII format.

In python there are many wrappers for gnuplot but all seems to fall short on the list of requirements:

  • support python2 and python3
  • wrap parameters and commands properly instead of being just a thin execution layer
  • avoid writing down to file system

Also I would like something that is platform indipendent and relying on gnuplot seems to be a deal breaker. This is a nice-to-have, not a strict requirement.

Any suggestion?

I would like to avoid writing my own wrapper and add noise to the ecosystem but the options available seem too rough.

Chobeat
  • 3,445
  • 6
  • 41
  • 59
  • What do you need to plot? ;) – Roelant Jun 09 '17 at 11:47
  • I want to be open to as many possibilities as I can. For now unidimensional and bidimensional data in general, both on a cartesian plane, and as histograms (for unidimensional). In the future I may need graphs but I already saw there are some options for that. – Chobeat Jun 09 '17 at 11:50
  • https://stackoverflow.com/questions/123378/command-line-unix-ascii-based-charting-plotting-tool – user8153 Jun 09 '17 at 21:29
  • gnuplot doesn't work with python3. I developed my MVP with it and now I need to replace it. – Chobeat Jun 10 '17 at 09:11

1 Answers1

1

You can try this one: https://github.com/mzechmeister/python/wiki/gplot.py

  • supports python2/python3/jupyter
  • supports all commands
  • option how to transmit data (see parameter tmp: tmpfiles, datablock, etc.)
>>> from gplot import *
>>> gplot.term("dumb")
<gplot.Gplot object at 0x7fd394c17d10>
>>> gplot('sin(x)')
>>> 

    1 +--------------------------------------------------------------------+   
      |               ** **              +  ** **         +       *  *     |   
  0.8 |-+             *   **               **   *           sin(x*********-|   
      |              **    *               *    **               *    *    |   
  0.6 |-+            *     **              *     *              *      * +-|   
      |              *      *             **     **             *      *   |   
  0.4 |*+           *       *             *       *             *       *+-|   
      |*            *        *           **       *            *        *  |   
  0.2 |*+          **        *           *         *           *        *+-|   
      | *          *         *           *         *          **         * |   
    0 |-*          *          *         **         *          *          *-|   
      | *         **          *         *           *         *          * |   
 -0.2 |-+*        *           *         *           *        **          +*|   
      |  *        *            *       **           *        *            *|   
 -0.4 |-+*       *             *       *             *       *           +*|   
      |   *      *             **     **             *      *              |   
 -0.6 |-+ *      *              *     *              **     *            +-|   
      |    *    *               **    *               *    **              |   
 -0.8 |-+  *   **                *   **               **   *             +-|   
      |     *  *       +         ** **   +             ** **               |   
   -1 +--------------------------------------------------------------------+   
     -10              -5                 0                5               10   


>>>