News for hackers. Stuff that matters.
Re:UnicodePlots by rmeno12 on Sunday April 09, 2023 @04:26PM (#35506154)
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.
Re:UnicodePlots by jrichardshaw on Sunday April 09, 2023 @04:35PM (#35506237)
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.
Re:UnicodePlots by folkrav on Sunday April 09, 2023 @05:04PM (#35506454)
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.
Re:UnicodePlots by fwlr on Sunday April 09, 2023 @08:21PM (#35507790)
iTerm2 is GPU accelerated since 2018, yes. Other terminals on Mac that I know of (Kitty, Alacritty, Warp) are also GPU accelerated.
Re:UnicodePlots by enriquto on Monday April 10, 2023 @06:03AM (#35510703)
You don't really need GPU acceleration for 2d graphics (and neither for simple 3D). The CPU is more than enough for that.
Re:UnicodePlots by folkrav on Tuesday April 11, 2023 @09:14AM (#35524664)
I understand, but without some kind of direct rendering going on, I can't see how this would work on a terminal emulator.
Re:UnicodePlots by enriquto on Tuesday April 11, 2023 @12:59PM (#35527895)
> without some kind of direct rendering going on, I can't see how this would work on a terminal emulator.

Nah.

You just dump the pixels one by one to the screen using a for loop. You can even do some cpu math with each pixel if you want, and and the end you call XPutImage with the raster (or whatever your toolkit offers). This runs at more than 30fps in fullhd on a 10 year old cpu.

Notice that xterm is blazingly fast and runs entirely on the cpu.

The GPU is not really needed for the basic stuff a terminal emulator does. Of course, if you want to do crazy stuff like scaling by enormous factors, or ultra-fast scroll without skipping tricks, you'll need GPU support.

Re:UnicodePlots by folkrav on Wednesday April 12, 2023 @11:42AM (#35541622)
I see. I'm not nearly qualified enough to talk about that, admittedly. Drawing the pixels isn't the problem, it's updating them fast enough, then?
Re:UnicodePlots by enriquto on Wednesday April 12, 2023 @01:26PM (#35543381)
I guess there is no problem? You only need the gpu to compute fancy 3d graphics in high resolution. For normal terminal stuff and low resolution plots, anything should work.
Re:UnicodePlots by abhishekbasu on Sunday April 09, 2023 @04:33PM (#35506222)
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/

Re:UnicodePlots by dr_kiszonka on Sunday April 09, 2023 @04:49PM (#35506351)
The last time I used gnuplot was around 25 years ago. And it is still around!
Re:UnicodePlots by csdvrx on Sunday April 09, 2023 @08:45PM (#35507952)
A few years ago, you had to recompile it to add sixel support on debian, so I provided https://github.com/csdvrx/sixel-gnuplot

Now it's included by default IIRC

Re:UnicodePlots by joouha on Sunday April 09, 2023 @05:24PM (#35506621)
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

Re:UnicodePlots by aumerle on Sunday April 09, 2023 @10:40PM (#35508645)
Re:UnicodePlots by lejalv on Monday April 10, 2023 @03:54AM (#35510103)
Have a look at Uniplot - https://github.com/olavolav/uniplot