简单、可编程的数据绘图

发布于 2024-07-26 20:52:59 字数 566 浏览 7 评论 0原文

我大部分时间都花在绘制数据上,但不幸的是我还没有找到满足我的绘图需求的合适解决方案。 目前,我发现的最强大、最令人愉快的绘图库是 matplotlib。 结果令人惊叹,但我大部分时间都花在与图书馆斗争上,尝试做一些简单的事情,比如随心所欲地制作箭头。 R 和 gnuplot 等类似程序产生的结果在视觉上不太吸引人,而且它们不是基于 GUI 的。

另一方面,像 xmgrace(或更好)这样的程序允许直接操作绘制的对象和直接反馈,但它们在两个重要的点上失败:

  1. 如果我的数据集(通常存储在 csv 文件中)由于某种原因发生更改,我必须重新导入一旦
  2. 我获得了一个很好的绘图设置,我必须重新创建绘图的唯一方法是使用图形交互式程序。 我希望能够在我的 csv 文件上运行命令行实用程序并获得 .pdf 结果,而无需人工干预。

我仍然需要找到能够为我提供两个世界的东西,并且价格实惠。 理想情况下,我需要一个交互式 GUI 程序(la Origin)来生成基于 matplotlib 的 python 脚本。

有谁对可以满足我在 OSX(最好)或 Linux 上的需求的软件有任何提示吗?

I spend most of my time plotting data, but unfortunately I haven't found a decent solution for my plotting needs. At the moment, the most powerful and pleasant library I found that performs plotting is matplotlib. The results are stunning, but I mostly spend my time fighting with the library when trying to do simple things like having an arrow as I want. SImilar programs like R and gnuplot produce visually less appealing results, and they are not GUI based.

On the other hand, programs like xmgrace (or better) allow direct manipulation of the plotted objects and direct feedback, but they fail on two important points:

  1. if my dataset (normally stored in csv files) changes for some reason, I have to reimport it and perform the manipulations again, by hand
  2. once I obtain a nice plot setup, the only way I have to recreate the plot is to use a graphical, interactive program. I would like to have the possibility to run a command line utility on my csv files and get the .pdf as a result, with no human intervention.

I still have to find something that provides me both worlds, and it has an affordable price. Ideally, I would need an interactive GUI program (a la Origin) to generate matplotlib-based python scripts.

Does anyone have any hints on software that could address my needs on OSX (preferably) or Linux ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

伤痕我心 2024-08-02 20:52:59

您可能需要查看 Igor Pro。 它相当古老且古怪,但它提供了我在 Mac 上发现的最先进的绘图系统。 您可以在命令行或脚本文件中以图形方式修改任何内容。 最强大的功能 (IMO) 是能够自动生成脚本来重新创建图形,或使用图形创建脚本来生成类似于特定图形(风格等)的图形。 我用 Igor 来制作我制作的所有出版物图片。

数据存储在“波”(翻译:矢量)中,它封装了数据和有关数据点之间增量的信息(例如时间步长)。 数字参考波浪作为其数据源。 当您更新波形时(例如,通过重新导入 CSV 文件并指定数据覆盖特定波形),引用该波形的所有图形都会自动更新。

您可以创建“布局”,它们是包含多个图形的页面布局。 每当布局中的任何图形更新时,这些布局也会自动更新(见上文)。 您可以向图形或布局添加绘图/文本/注释。

请注意:Igor Pro 的脚本语言有点像 VB 和 Matlab 的混种语言。 它让我的眼睛流血。 这让我向上帝祈祷,希望痛苦能够结束。 但是整个系统是如此强大,所以这是值得的。

You may want to check out Igor Pro. It's quite old, and quirky but it provides the most advanced plotting system I've found yet on the Mac. You can modify anything graphically, at a command line or in script files. The most powerful feature (IMO) is the ability to automatically generate a script to recreate a figure or to use a figure to create a script that generates figures like (in style etc.) a particular figure. I use Igor for all publication figures I produce.

Data is stored in "waves" (translation: vectors) which encapsulate data and information about the delta between data points (e.g. time step). Figures reference waves as their data source. When you update a wave (e.g. by re-importing a CSV file and specifying that the data overwrite specific waves), all figures that reference that wave are automatically updated.

You can create "layouts" which are page-layouts containing multiple graphs. These layouts are also automatically updated whenever any of the figures in the layout are updated (see above). You can add drawing/text/annotations to either graphs or layout.s

Be warned: Igor Pro's scripting language is something like the bastard child of VB and Matlab. It makes my eyes bleed. It makes me pray to whatever God that the pain just end. But the entire system is so powerful that it's worth it.

乞讨 2024-08-02 20:52:59

我一直使用 Matlab 或 R 来做这类事情。 虽然你可能不喜欢通用图的外观,但我发现一旦我熟悉了这些库,我就可以让它们像我想要的那样精美。

R 是免费的,我会尽力坚持下去。 它非常强大并且完全适合您的需求(直接从数据文件动态生成图表)。 我敢打赌,您对它越熟悉,您就会发现自己可以使用 R 来完成绘制数据之外的各种任务。

I have always used Matlab or R for this sort of thing. While you may not like how the generic plots look, I find that once I familiarize myself with the libraries I can make them as fancy as I want them to be.

R being free, I would try to stick it out with that. It is extremely powerful and perfectly suited to what you need (generate charts on the fly directly from datafiles). I bet that the more you get comfortable with it, you'll find yourself using R for a wide range of tasks outside of plotting data.

病毒体 2024-08-02 20:52:59

MathGL 是跨平台 GPL 库,满足您的所有标准。 它可以生成漂亮的图形,它可以读取 csv 文件,它有用于显示图形的窗口(您不需要了解小部件库),并且它可以在控制台中绘图(根本不需要窗口或 X)。 为简单起见,您可以使用 C/C++/Fortran/Python/... 作为您自己的代码或 MGL 脚本(请参阅 UDAV 最后一种情况的前端)。

最后它可以生成位图(PNG/JPEG/GIF/...)或矢量(EPS/SVG)输出。 稍后可以轻松将其转换为 PDF。 或者您可以直接使用 U3D 创建 PDF——在这种情况下您将需要 HPDF 和 U3D 库。

MathGL is cross-platform GPL library which meet all yours criteria. It can produce nice graphics, it can read csv files, it have window for displaying graphics (you don't need to know widget libraries), and it can plot in console (don't need a window or X at all). At this you can use C/C++/Fortran/Python/... for yours own code or MGL scripts for simplicity (see UDAV front-end in the last case).

Finally it can produce bitmaps (PNG/JPEG/GIF/...) or vector (EPS/SVG) output. Later it can be converted to PDF easily. Or you can create a PDF with U3D directly -- you'll need HPDF and U3D libraries in this case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文