Traceback (most recent call last):
File "PSPsolver1.py", line 520, in getchain
Publisher().sendMessage(("show.mainframe"), msg)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub/pubsub1 /pub.py", line 750, in sendMessage
self.__topicTree.sendMessage(aTopic, message, onTopicNeverCreated)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub/pubsub1/pub.py", line 423, in sendMessage
deliveryCount += node.sendMessage(message)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/pubsub/pubsub1/pub.py", line 261, in sendMessage
listener(message)
File "PSPsolver1.py", line 1112, in showFrame
createfigure()
File "PSPsolver1.py", line 927, in createfigure
x_ax.imshow(xcolors, cmap=cmap, interpolation='none')
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 6749, in imshow
filterrad=filterrad, resample=resample, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 547, in __init__
**kwargs
File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 94, in __init__
self.set_interpolation(interpolation)
File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 458, in set_interpolation
raise ValueError('Illegal interpolation string')
ValueError: Illegal interpolation string
我对matplotlib有问题 我有一段代码在一台计算机上运行,但是当我试图在另一台计算机上运行时,它似乎不起作用,我得到了这个错误 有什么建议吗?在
你的代码使用
在
PSPsolver1.py
的第927行。参数interpolation='none'
是在matplotlib版本1.0.1和1.2.0之间引入的。在所以我猜您的两台机器运行的matplotlib版本不同,其中一个版本不够新。在
解决这个问题的一种方法是(当然)更新matplotlib的旧版本。如果这不是一个选项或者您不想这样做,那么请注意the docs say:
因此,如果您没有使用
^{pr2}$Agg
、ps
或pdf
后端,可以将行更改为当然,如果您采用这种方法,可能还有其他代码也使用了更新的matplotlib特性。它们可能不那么容易修复。在
相关问题 更多 >
编程相关推荐