[HN Gopher] Plotext - Python Plotting on the Terminal
       ___________________________________________________________________
        
       Plotext - Python Plotting on the Terminal
        
       Author : animal_spirits
       Score  : 88 points
       Date   : 2021-07-03 06:18 UTC (16 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | kzrdude wrote:
       | It is also possible to use kitty or other graphics capable
       | terminal (iTerm2, mlterm etc) to show regular images inline when
       | plotting from ipython3 or jupyter console (some extensions need
       | to be installed).
        
         | fzimmermann wrote:
         | Do you remember which extension?
        
           | kzrdude wrote:
           | This is one example https://github.com/grst/jukitty
           | 
           | I have some home made ones (working for kitty and
           | mlterm/sixel etc), but they are not in shape for releasing.
           | 
           | ipython3 and jupyter console both have an image display hook
           | you can use, but they work in different ways.
        
         | ziotom78 wrote:
         | When using the Julia REPL I regularly use KittyTerminalImages
         | [1], which is awesome because it fits perfectly with other
         | plotting packages.
         | 
         | [1] https://github.com/simonschoelly/KittyTerminalImages.jl
        
           | kzrdude wrote:
           | Cool. The frontier for all of us is now to get screen and
           | tmux to support it. Unfortunately it needs their buy-in
           | (escapes/passthroughs don't work at all with scrollback)
        
       | sharikous wrote:
       | I really like this kind of thing, especially for debugging, but
       | for such visualizations simple is better (if I wanted something
       | fancier I'd use a GUI).
       | 
       | I use now hipsterplot, since it is much simpler and tweakable,
       | but I wonder if heatmaps will be possible with this tool, since
       | it uses color it could be
        
       | chaganated wrote:
       | stockholm syndrome
        
       | dima55 wrote:
       | https://github.com/dkogan/gnuplotlib/ (for python) and
       | https://github.com/dkogan/feedgnuplot/ (commandline interface)
       | both have a "dumb" terminal that does this.
        
       | barbazoo wrote:
       | It would be cool if we could pipe any 2 dimensional data to this
       | in the shell and it would render it. Also how does one read 2
       | dimensional data from CSV for instance? I wanna say sed but I
       | don't know.
       | 
       | It would be handy for quick ad-hoc days analysis of log files or
       | access logs.
        
       | luoc wrote:
       | Why would one mimic matplotlib's API besides the fact that
       | everyone knows it?
       | 
       | I use matplotlib a lot but I keep googling the same things again
       | and again, which is my subjective indicator that something in the
       | design is wrong. How to set log scales again? Do I apply this
       | method to the figure or axis object? Setting a different backend
       | (like agg) after pyplot was importet? Also, nested kwargs make it
       | impossible for my IDE to give meaningful hints on parameters, not
       | even talking about typed interfaces so far. Global state!
       | 
       | I mean, this library solves a truly complex problem and yes, I
       | get things done but none of the hours working with it was close
       | to be pleasant.
       | 
       | I wish some day someone is brave enough to enter new lands,
       | leaving this matlab style of thinking behind.
        
         | id_ris wrote:
         | There is no good reason to mimic matplotlib's API except that
         | everyone knows it.
        
       | ConfusedDog wrote:
       | I wanted something like this, but unfortunately there are some
       | "black bars" generated that distorted the plot in my Windows
       | Terminal. Hopefully they fix it. I've never got IPython
       | interactive mode to work with Matplotlib. Alternative is just
       | Jupyter notebook, then I had leave the terminal. I guess it's not
       | a big deal, but something like this would help.
        
         | toomanyducks wrote:
         | which windows terminal? Last time I had to use cmd or power
         | shell, I ended up losing random lines of output. The new one
         | (I'm blanking on the name) didn't have that problem, though.
        
           | justusthane wrote:
           | Ironically, the new one is called "Windows Terminal".
        
       | olavolav wrote:
       | Very cool library!
       | 
       | As alternatives I might recommend hipsterplot (the name) or
       | uniplot (very similar but lighter, I'm the author).
        
       | id_ris wrote:
       | Did you consider creating a backend for Matplotlib which rendered
       | to ascii?? That way a matplotlib user could simply switch
       | backends when on the terminal, and then switch to something else
       | when the execution context changes. I don't know if that's even
       | feasible, but that was what I first this was when I saw plt.
        
       | frankensteins wrote:
       | For me, this is a good alternative to matplotlib when I try to
       | visualize a plot using WSL.
       | 
       | [edit]: matplotlib always crashed on me and failed to find Qt
       | library.
        
         | lasagnaphil wrote:
         | This also seems like a good choice if you're training a model
         | in a headless server via SSH and just want to plot out some
         | data fast.
        
       | enriquto wrote:
       | Next step is to rediscover the 50-year old tektronix mode of
       | xterm, and use _that_ for cleaner vector graphics.
        
       | temp8964 wrote:
       | R has something similar, it's called textplot.
        
         | sundarurfriend wrote:
         | And Julia has UnicodePlots
         | (https://github.com/Evizero/UnicodePlots.jl).
        
       | 3dsynd wrote:
       | Looks nice, but when might it be needed?
        
         | sharikous wrote:
         | Debugging, mainly. And really really dirty and fast workflows,
         | when you don't have time to do pretty graphics.
         | 
         | The other thing is not depending on GUIs, libraries, and stuff,
         | makes it resilient and usable in hard conditions (e.g. if you
         | accidentally remove some core system libraries but you still
         | want to see a graph)
        
         | ziotom78 wrote:
         | I use regularly UnicodePlots.jl for Julia when connected
         | through ssh to HPC servers. It has boosted my productivity!
        
         | temp8964 wrote:
         | One possible use case is you run a CLI monitor app (stock,
         | website traffic, etc.) and you need simple plots in it .
        
         | enriquto wrote:
         | ...always? Very often it's much cleaner to see your plots
         | "inline" that on a separate window.
        
       ___________________________________________________________________
       (page generated 2021-07-03 23:02 UTC)