来自标准输入的实时绘图
我有一个将数字打印到标准输出的应用程序。有没有一种简单的方法可以使用任何命令行绘图工具(gnuplot)来实时绘制图像?
I have an application which prints numbers to stdout. Is there an easy way of using any commandline plot tool (gnuplot) for a live plot of the image?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我强烈推荐 ttyplot,您可以直接在终端中构建实时图表,从 STDIN 读取数据
另一种选择是使用 sampler:用于 shell 命令执行、可视化和警报的工具。使用简单的 YAML 文件进行配置。
I would highly recommend ttyplot, you can build live graphs directly in the terminal, reading data from STDIN
Another option is to use sampler: Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
您可以将数字重定向到文件,并使用 gnuplot 的重读命令或在绘图窗口上手动按
e
定期读取该文件。在 gnuplot 中
并按窗口上的
e
来更新它,或者查看示例You can redirect the numbers to a file and read the file periodically either using gnuplot's reread command or manually pressing
e
on the plot window.In gnuplot
and press
e
on the window to update it, or see the example from我为此编写了 livechart
目的。它基于 matplotlib,接受数字或 JSON 对象
通过
stdin
获取数字数据。请注意,建议使用 Python2.7,因为 matplotlib 不太适合
我3.x以下。另外,您可能需要安装 C++ 编译器来构建
matplotlib(Debian 上
sudo apt-get install g++
)。I wrote livechart for exactly this
purpose. It's based on matplotlib and accepts either numbers or JSON objects
with numeric data via
stdin
.Note that Python2.7 is recommended because matplotlib wouldn't quite work for
me under 3.x. Also, you might need to install a C++ compiler to build
matplotlib (
sudo apt-get install g++
on Debian).您可以使用 plotti.co 将您的绘图导出到网络上,如下所示:
您将实时查看它地址 http://plotti.co/4134314/plot.svg
免责声明:I我是plotti.co 的创建者
You can use plotti.co to export your plot to the web in a one-liner like this:
And you will view it live at address http://plotti.co/4134314/plot.svg
Disclaimer: I am the creator of plotti.co