TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Create Matplotlib visualizations from the command-line

11 pointsby dmouraabout 3 years ago
I do lots of data analyses in the command-line and I was missing a simple utility to plot the output of a command (without having to script it). I like very much the Matplotlib API but I found no CLI to pipe data into it. So, I wrote MatplotCLI, a simple CLI that reads data from the stdin and allows to easily create interactive plots from the command-line. Have a look at the README for examples and recipes. Let me know what you think, thanks!<p>Some examples:<p><pre><code> $ plt &quot;hist(x,30)&quot; &lt; sample.json $ cat sample.json | plt --no-show &quot;hist(x,30); savefig(&#x27;myimage.png&#x27;)&quot; $ plt --no-input &quot; x = np.linspace(-1,1,2000); y = x*np.sin(1&#x2F;x); plot(x,y); axis(&#x27;scaled&#x27;); grid(True)&quot; $ echo &#x27; {&quot;a&quot;:0, &quot;b&quot;:1} {&quot;a&quot;:1, &quot;b&quot;:0} {&quot;a&quot;:3, &quot;b&quot;:3}&#x27; | plt &quot;plot(a,b)&quot;</code></pre>

no comments

no comments