Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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!



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).


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.


It is useful for people who don't realize xterm(1) supports Sixel graphics. :-)

It still blows people away when I set my GNUTERM var to 'sixelgd font "Arial,8" size 800, 600'

In xterm, you can use bash to type these two lines:

   $ export GNUTERM='sixelgd font "Arial, 8" size 800, 600'
   $ gnuplot -e 'plot sin(x)'
And poof! a plot will appear.


It's useful for people who work with data, like in ml, data science, etc.


Or for sysadmin or anything where a quick plot at the data gives you hints at what's happening.

In the example screenshot I put on https://raw.githubusercontent.com/csdvrx/sixel-gnuplot/maste..., I was investigating time sync issues.

A plot immediately told me my first fix had corrected the issue on 2 servers, but I had mistakenly applied the same change to a 3rd one.


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.


You can normally add images to PRs though?


Turning the same data into an image provides no additional info and requires extra steps. The key requirement here for my feature is copy and paste from the terminal.


Best example I can think of is cases where you can’t really put an image, eg commit messages (especially if you don’t have something like pull requests where you can put images).

Some terminal emulators have support for images, which fit most of the use cases here but not the one I described.

I would hope that most people would generate charts with a notebook (jupyter, pluto, orgmode can all have actual images though when I briefly used pluto, I was going mad trying to (a) not get an svg which would suck for a lot of points and (b) get bigger plots in the notebook) or that at the repl you would get something like R and have an X window with the plot rendered to it (tip: dbcairo makes plots over X forwarding much better).


> Some terminal emulators have support for images, which fit most of the use cases here but not the one I described.

That what sixel-tmux is for, when you're in a hurry and needs images with your current terminal emulator: https://github.com/csdvrx/sixel-tmux


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.


Another possible use case is for inline expect tests.

It can both help someone understand the function easier by seeing a plot in the source while also serving as a test.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: