News for hackers. Stuff that matters.
Re:Show HN: Plot directly in your terminal with matplotlib by jpeanuts on Tuesday February 21, 2017 @05:43PM (#13700849)
Gnuplot has an output mode - called "dumb" - that prints an ASCII plot to the terminal. See e.g. http://pastebin.com/WHcLZHPr This is very handy when running scientific codes on remote machines, and works in any terminal (not just iTerm2 like the submission).

I've been looking for a matplotlib extension to do the same thing, without success.

Re:Show HN: Plot directly in your terminal with matplotlib by Y_Y on Tuesday February 21, 2017 @05:46PM (#13700878)
Have you tried using cacaview on images? When I'm running scientific code on remote machines I use jupyter tunneled over ssh, but I assume you can't do that.
Re:Show HN: Plot directly in your terminal with matplotlib by jpeanuts on Tuesday February 21, 2017 @06:26PM (#13701225)
Thanks for the two(!) nice tips. Just looked at libcaca, but I'm having trouble installing on my laptop (OSX). Anyway the idea is mainly to remove gnuplot as a dependency from my scientific code; introducing a new dependency defeats the point a bit.

Jupyter would be a very nice way to interact - as you guess there are difficulties: playing well with the cluster queueing system, and currently the code is launched via an mpirun call. I'm open to suggestions.

Edit: This sounds like exactly what I need! http://ipython.org/ipython-doc/stable/parallel/parallel_intr...

Re:Show HN: Plot directly in your terminal with matplotlib by daleroberts on Tuesday February 21, 2017 @06:42PM (#13701363)
You can checkout my other project https://github.com/daleroberts/tv which allows you to view images in any terminal supporting Unicode 9.0 fonts and true color. It uses GDAL for the backend which is easy to install on a Mac with:

    brew install gdal --without-python --HEAD
    pip install gdal
Re:Show HN: Plot directly in your terminal with matplotlib by throwanem on Wednesday February 22, 2017 @06:19AM (#13704689)
Matplotlib has a "sixel" backend, which can render images in any terminal supporting the necessary protocol. Might be worth investigation, if you run or can run a terminal with that support - I was surprised how many do, either out of the box or recompiled to enable it.
Re:Show HN: Plot directly in your terminal with matplotlib by staz on Wednesday February 22, 2017 @10:07AM (#13706011)
I've looked a bit and only mlterm seems to support it out of the box at the momement (on ubuntu at least)

Xterm need an optionnal compile switch. Vte (gnome-terminal, xfce-terminal etc..) has an unmerged patch.

It's fun to play around with

Re:Show HN: Plot directly in your terminal with matplotlib by throwanem on Wednesday February 22, 2017 @12:06PM (#13707035)
Mintty's newer versions support it natively, as do a number of Linux console terminals.
Re:Show HN: Plot directly in your terminal with matplotlib by JosephRedfern on Wednesday February 22, 2017 @06:55AM (#13704828)
It's not as complete as matplotlib, but there is an ASCII plotting library which has a (very) similar API to matplotlib called bashplotlib: https://github.com/glamp/bashplotlib
Re:Show HN: Plot directly in your terminal with matplotlib by jxy on Tuesday February 21, 2017 @09:11PM (#13702303)
gnuplot is very nice in working like this. I've been using a script [0] to pipe data directly.

[0] https://gist.github.com/jxy/88f2972d3994dfea06fd2d3833b7ac8a

Re:Show HN: Plot directly in your terminal with matplotlib by dima55 on Tuesday February 21, 2017 @10:11PM (#13702666)
Why wouldn't you use gnuplot? If you want a numpy interface, there's this: https://github.com/dkogan/gnuplotlib
Re:Show HN: Plot directly in your terminal with matplotlib by krick on Tuesday February 21, 2017 @05:55PM (#13700965)
God, I want something like iTerm2 for Linux.
Re:Show HN: Plot directly in your terminal with matplotlib by badosu on Tuesday February 21, 2017 @07:33PM (#13701711)
Take a look at Terminology[0], it can print images such as the output from matplotlib.

0: https://www.enlightenment.org/about-terminology

Re:Show HN: Plot directly in your terminal with matplotlib by rafinha on Wednesday February 22, 2017 @02:39AM (#13703882)
"Never again be stuck not being able to see cats do stupid things in animated gifs when you don't have your web browser available" Lol they do know how to sell their software xD. Thanks for link.
Re:Show HN: Plot directly in your terminal with matplotlib by mmel on Tuesday February 21, 2017 @09:45PM (#13702512)
Linux terminal emulators have supported Tektronix 404x emulation for a long time. https://en.wikipedia.org/wiki/Tektronix_4010 https://www.youtube.com/watch?v=T-F7ZySfgZ0
Re:Show HN: Plot directly in your terminal with matplotlib by david-given on Wednesday February 22, 2017 @08:28AM (#13705270)
Tek emulation is very cool, and I wish it were possible to use it more... but the protocol doesn't allow you to clear parts of the screen, so the only way to undraw stuff is to clear the entire screen and redraw from scratch. This makes it really limited for interactive use.

(This limitation is there because the original display terminals used storage scopes with persistent phosphor --- there was no framebuffer, you just steered the electron beam around on the screen and lit areas stayed lit.)

Re:Show HN: Plot directly in your terminal with matplotlib by mcpherrinm on Tuesday February 21, 2017 @06:02PM (#13701028)
The iterm image support is pretty simple (just a VT100-style command wrapped around a base64 encoded png). Maybe somebody can implement it for gnome/vte or something, and see if there's any traction.
Re:Show HN: Plot directly in your terminal with matplotlib by tavert on Tuesday February 21, 2017 @09:20PM (#13702345)
You can build xterm with sixel support https://github.com/saitoha/libsixel
Re:Show HN: Plot directly in your terminal with matplotlib by zer0t3ch on Tuesday February 21, 2017 @07:05PM (#13701532)
I know it's not a traditional terminal, but GateOne actually has this. It's pretty interesting to use, weird to see a full quality picture in the middle of a terminal.
Re:Show HN: Plot directly in your terminal with matplotlib by widdma on Wednesday February 22, 2017 @07:59AM (#13705107)
iTerm2's killer feature that I haven't seen in any Linux terms yet is tmux integration. Being able to treat a remote tmux session like a local terminal session — including tabs, splits and windows — is fantastic.
Re:Show HN: Plot directly in your terminal with matplotlib by Adaptive on Tuesday February 21, 2017 @09:26PM (#13702387)
iTerm2 is nice, but Linux has a zillion terminal emulators. I'm running images inside of urxvt right now using w3m. https://twitter.com/ethanschoonover/status/83422756684828672...
Re:Show HN: Plot directly in your terminal with matplotlib by venachescu on Tuesday February 21, 2017 @07:40PM (#13701768)
You are literally making my dreams come true. Thank you!
Re:Show HN: Plot directly in your terminal with matplotlib by stestagg on Wednesday February 22, 2017 @06:48PM (#13710369)
You have weird dreams
Re:Show HN: Plot directly in your terminal with matplotlib by wallstquant on Tuesday February 21, 2017 @10:26PM (#13702742)
Julia has something similar too. TerminalExtensions.jl

https://groups.google.com/forum/m/#!topic/julia-users/zj4nQl...

Re:Show HN: Plot directly in your terminal with matplotlib by Lxr on Tuesday February 21, 2017 @07:43PM (#13701781)
Great idea, I was just thinking yesterday that something like this should exist. Matplotlob seems to like automatically switching windows every time you plot something, so annoying!
Re:Show HN: Plot directly in your terminal with matplotlib by Lxr on Wednesday February 22, 2017 @12:10AM (#13703193)
Hmm, I used the back button on my phone after submitting a comment and it must have resubmitted the form, and now I can't delete the dupe.
Re:Show HN: Plot directly in your terminal with matplotlib by maddyboo on Tuesday February 21, 2017 @08:55PM (#13702217)
Any idea of how to do something like this for R?
Re:Show HN: Plot directly in your terminal with matplotlib by em500 on Tuesday February 21, 2017 @09:48PM (#13702529)
Re:Show HN: Plot directly in your terminal with matplotlib by curiousgal on Wednesday February 22, 2017 @03:02AM (#13703977)
Reminds me of Maple, it came with a console version that can render plots in ASCII.