Gnuplot for Python 3

做~自己de王妃 提交于 2020-01-16 19:29:49

问题


I have a problem with python 3.2.3 and Gnuplot. I have installed gnuplot-4.6.1, it's going well with defaults demo, but an error occurs when i want to import the module in the python environnement.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Gnuplot

I don't know what's wrong with python3

ps: before gnuplot-4.6.1, i had gnuplot1.8 and i used it for plot


回答1:


I assume you need to install Gnuplot-py for your version of python.

Since Gnuplot-py doesn't seem to be actively supported much these days, I'm not sure if it will work on python3.x or not (You'll need to try it and see).

Another option is pyGnuplot which I develop and I aim to keep it py3k compatable (although I don't test that very often). It is not a drop in replacement for Gnuplot-py however, so you'd need to change your code in order to use it.

Finally, (probably the most popular option these days) is matplotlib. My impression is that it gives an interface which is designed to make people familiar with MATLAB a little more comfortable and it is pretty powerful. I know a lot of people are very happy with it.



来源:https://stackoverflow.com/questions/12840306/gnuplot-for-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!