Python 中 matplotlib 的 (x,y) 绘图替代方案是什么?
我已经尝试了几个小时来下载/构建/安装/使用 matplotlib
并且我我无计可施了。我终于构建并运行了它,但尽管调用了 plt.show(),但没有显示任何内容。
有 matplotlib 的替代品吗?我只需要 Python 中的一些东西来以线或点的形式绘制 (x,y) 数据。 (我在 Mac OSX 10.6 中运行 Python 2.7)
编辑:请向我指出除 matplotlib 之外的任何信誉良好的软件包的二进制安装程序源。由于某种原因,在我的机器上从源代码构建似乎遇到了麻烦。
I've been trying for several hours to download/build/install/use matplotlib
and am at my wit's end. I finally got it to build and it runs but doesn't display anything despite calling plt.show()
.
Is there an alternative to matplotlib? I just need something in Python to graph (x,y) data, in either lines or points. (I'm running Python 2.7 in Mac OSX 10.6)
edit: please point me at a source of binary installers for any reputable package besides matplotlib. Building from source code on my machine seem to have trouble for some reason.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
自从发布这个问题以来,我发现了免费的 Anaconda Python ,它已经为主要平台预编译了二进制文件,并包括 matplotlib,所以我一直在使用它。
Since posting this question I found out about the free Anaconda Python which has precompiled binaries for the major platforms, and includes matplotlib, so I've been using that.
即使 .dmg 文件也不会从 此处?
不过还有其他选择。有 Chaco、gnuplot,你还可以从 Python 调用 R 等。
Even the .dmg files don't install, say, from here?
There are other options though. There's Chaco, gnuplot, and you can call R from Python, etc.
如果您只是需要绘制点和线,您可以使用 Tkinter(可能已经安装)并使用画布小部件。它就像它听起来的那样:一块空白画布,带有用于绘制线条、点等的图元。
If you just need to plot points and lines, you could use Tkinter (which is probably already installed) and use a canvas widget. It's pretty much what it sounds like: a blank canvas with primitives for drawing lines, points, etc.
看看 PyCha 或 pyCairoChart 如果您正在寻找简单的 Matplotlib 替代品。它们当然不如 Matplotlib 那么成熟或通用,但它们可能对您来说已经足够了。
Take a look at PyCha or pyCairoChart if you are looking for simple Matplotlib alternatives. They are of course not as mature or versatile as Matplotlib is, but they might be enough for you.
首先,matplotlib 应该是可安装的,并且大多数 python 平台都可以安装,它已经成为使用 python 绘图的事实上的标准。得知您在安装过程中遇到困难,我感到很难过。
其次,你可以看看 ScientificPython (不要与 scipy 混淆) 。它有一个简单的 TkPlotCanvas,提供了一些围绕 TkInter 画布小部件的抽象。也许您可以找到一种方法将相关部分合并到您的项目中。许可证是 CeCILL,也是另一个开源变体。我不知道您的项目及其许可证,但这可能会导致绘图的无缝集成,而无需外部依赖项。
First, matplotlib should be installable and most python plattforms, it has become a de-facto standard for plotting with python. I'm sad to read that you are struggling with the installation.
Second, you could have a look at ScientificPython (not to confuse with scipy). It has a simple TkPlotCanvas, providing some abstraction around the TkInter canvas widget. Maybe you can find a way to incorporate the relevant parts into you project. The license is CeCILL, yet another open-source variant. I don't know about your project and its license, but this could lead to seamless integration of plotting, without external dependencies.
您可以尝试 Charts 库,它使您能够使用优秀的 javascript Highcharts 库。
该库主要是 HTML/Javascript,仅使用 python 标准库,因此它可以轻松安装在任何平台上。与 matplotlib 相比,它提供了几乎所有的功能,并且能够制作交互式图表!
免责声明:我是该库的开发者。
You could try the Charts library which enables you to make plots in Python using the excellent javascript Highcharts library.
The library is mainly HTML/Javascript and only uses python standard libraries so it installs easily on any platform. Compared to matplotlib it offers almost all of their features and is able to make interactive charts!
Disclaimer: I'm the developper of the library.