[HN Gopher] UnicodePlots
___________________________________________________________________
 
UnicodePlots
 
Author : dunefox
Score  : 82 points
Date   : 2023-04-09 19:22 UTC (3 hours ago)
 
web link (github.com)
w3m dump (github.com)
 
| NelsonMinar wrote:
| Really neat! Every time I see this I'm reminded of what we lost
| from the 1990s, when xterm supported Tektronix 4014 emulation.
| Vector graphics right there via a tty interface! It wasn't
| terribly useful in practice but it could do some nice things with
| plotting.
 
  | joshu wrote:
  | iterm2/wezterm/etc will display images.
  | 
  | https://iterm2.com/documentation-images.html
  | 
  | there is also sixel. https://github.com/saitoha/libsixel
 
| hsjqllzlfkf wrote:
| [dead]
 
| crazygringo wrote:
| Wow. That's crazy.
| 
| Genuine question: is this actually useful in real life, or just a
| cool "because I could" project?
| 
| Not being a Julia programmer I'd assume that producing charts in
| a REPL would be done in a Jupyter notebook with real pixels, not
| Unicode.
| 
| Is producing elaborate charts in a terminal something people
| actually need?
| 
| Edit: some fantastic responses. Makes perfect sense. Thank you!
 
  | KenoFischer wrote:
  | Yes, it's useful when you're ssh'd into some production system
  | somewhere and just want to get a quick sense of some data in
  | memory instead of going through the steps of installing a full
  | graphics stack (which fortunately is pretty much a one-liner in
  | Julia also, but can take a few mins).
 
  | schneems wrote:
  | I added comparative histograms (normalized to the same axis)
  | for derailed benchmarks so that when I send a perf PR they get
  | the distribution data in an accessible format.
  | 
  | You can copy and paste it right into the comments or
  | description.
  | 
  | That's one use case.
 
    | IshKebab wrote:
    | You can normally add images to PRs though?
 
  | Tarrosion wrote:
  | Yeah, I find it super useful when you want a maximally quick
  | look at the shape of your data. Even if I'm local (ie not SSH'd
  | onto a remote system where displaying graphics could be a
  | hassle), using UnicodePlots can "break my flow" less than
  | generating prettier plots in another window.
 
  | dunefox wrote:
  | I used it for a cli script that reads a log file and creates a
  | histogram of the IPs. Pretty good if you don't want to save an
  | image every couple of minutes. It's just text.
 
| martinsmit wrote:
| Nice to see a non-trivial package with 100% code coverage, can't
| remember the last time I saw that.
 
| rmeno12 wrote:
| Is there such a tool for use with python? preferably matplotlib
| compatible. I often find myself needing to plot some data to get
| a quick idea of what it looks like, and my work is generally on a
| remote host. Having to open a new ssh session with X forwarding
| is not difficult but a more frictionless approach would be nice.
 
  | abhishekbasu wrote:
  | There are [1, 2], and AFAICT they rely on gnuplot [3].
  | 
  | [1] https://github.com/nschloe/termplotlib [2]
  | https://github.com/dkogan/gnuplotlib [3]
  | http://www.gnuplot.info/
 
    | dr_kiszonka wrote:
    | The last time I used gnuplot was around 25 years ago. And it
    | is still around!
 
  | jrichardshaw wrote:
  | If you happen to use `iTerm2`, then
  | https://github.com/daleroberts/itermplot works very well. I've
  | used it before and can recommend it pretty highly.
 
    | folkrav wrote:
    | Is iTerm2 GPU accelerated? Wasn't aware it could do that kind
    | of thing. I didn't use it in years, admittedly, haven't had a
    | Mac for a while.
 
  | joouha wrote:
  | If you use euporie [1], you can draw plots in a Jupyter
  | notebook in the terminal using matotlib and friends, and have
  | them displayed using terminal graphics.
  | 
  | [1] https://github.com/joouha/euporie
 
___________________________________________________________________
(page generated 2023-04-09 23:00 UTC)