6 ms·
UnicodePlots
- hsjqllzlfkf 4y ago[dead]
- crazygringo 4y agoWow. 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 4y agoYes, 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).
- Tarrosion 4y agoYeah, 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 4y agoI 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.
- schneems 4y agoI 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.
- dan-robertson 4y agoBest 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).
- csdvrx 4y ago> 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 https://github.com/csdvrx/sixel-tmux
- ChuckMcM 4y agoIt 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.
- dunefox 4y agoIt's useful for people who work with data, like in ml, data science, etc.
- csdvrx 4y agoOr 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/master/example.jpg 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.
- EliasLittle 4y agoAnother 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.
- rmeno12 4y agoIs 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 4y agoThere are [1, 2], and AFAICT they rely on gnuplot [3]. [1] https://github.com/nschloe/termplotlib https://github.com/nschloe/termplotlib [2] https://github.com/dkogan/gnuplotlib https://github.com/dkogan/gnuplotlib [3] http://www.gnuplot.info/ http://www.gnuplot.info/
- dr_kiszonka 4y agoThe last time I used gnuplot was around 25 years ago. And it is still around!
- csdvrx 4y agoA few years ago, you had to recompile it to add sixel support on debian, so I provided https://github.com/csdvrx/sixel-gnuplot https://github.com/csdvrx/sixel-gnuplot Now it's included by default IIRC
- jrichardshaw 4y agoIf you happen to use `iTerm2`, then https://github.com/daleroberts/itermplot https://github.com/daleroberts/itermplot works very well. I've used it before and can recommend it pretty highly.
- folkrav 4y agoIs 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.
- martinsmit 4y agoNice to see a non-trivial package with 100% code coverage, can't remember the last time I saw that.
- NelsonMinar 4y agoReally 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 4y agoiterm2/wezterm/etc will display images. https://iterm2.com/documentation-images.html https://iterm2.com/documentation-images.html there is also sixel. https://github.com/saitoha/libsixel https://github.com/saitoha/libsixel
- ddrake18 4y agoCould this be adapted to be a backend for graphviz? I use org mode for notes, and sometimes want to draw graphs or diagrams using graphviz. With something like this, you could integrate graphviz source blocks with org-babel and evaluate the blocks to get nice textual output in your org file.
- nanobowers 4y agoRubyists may be interested in https://github.com/red-data-tools/unicode_plot.rb https://github.com/red-data-tools/unicode_plot.rb which is mostly a port of this package.
- 0x000xca0xfe 4y agoVery nice, this can be used to build a cool motd :) Not about this project specifically, but there seems to be a general trend towards TUIs. As someone currently working on a native GTK+ app, the state of native deskop UIs is horrible. GTK+ with all the depreciations? Painful. Win32? Oh god. UWP? Please, no. UIKit or Swift? Desktop software is no longer important enough to support multiple platforms natively... I feel like we are headed towards a split between Electron for end user applications and TUI for portable tools. They even run on servers and modern terminals on any platform can "render" the UI!
- nine_k 4y agoSo, VT220 (with some extensions like Unicode) is again going to become the common ground of somehow rich interfaces? In fact, this is happening. My filesystem UI is Midnight Commander for a long time, but my k8s UI is k9s, and it's new, and works equally effortlessly on a Mac and on a Linux box.
- timmaxw 4y ago> I feel like we are headed towards a split between Electron for end user applications and TUI for portable tools Another common hack is for a tool to serve a web UI on localhost, like Jupyter or Datasette. If you need to run the tool on a firewalled server, you can use SSH port forwarding to access the web UI.
- csdvrx 4y ago> Win32? Oh god. Uh, no? Win32: Simple to write, and works anywhere, thanks to wine. > Desktop software is no longer important enough to support multiple platforms natively Win32 is the closest we have to native multiplatform support with a single binary > TUI for portable tools If you use cosmopolitan, yes it can be even better: one binary working everywhere, with no need for emulators. I think wine compiled with cosmopolitan is the future: - if running on windows, don't use wine - on linux or macos, use wine > They even run on servers and modern terminals on any platform can "render" the UI! There are X servers rendering in sixel format, so the above could be completed by adding a this X server to render within a sixel-aware terminal (say for when X will be deprecated)
- hinkley 4y agoThere’s absolutely a place in the world for sparkline plots in TUIs and I need to get back to looking at things like that soon.