by crazygringo · 3y ago · 0 comments
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!
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.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.
You can copy and paste it right into the comments or description.
That’s one use case.
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).
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
It can both help someone understand the function easier by seeing a plot in the source while also serving as a test.