trouble with matplotlib pubsub python -
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
i having trouble matplotlib have piece of code working on 1 computer, when try run on computer doesn't seem work , error suggestions on do?
your code uses
x_ax.imshow(xcolors, cmap=cmap, interpolation='none')
on line 927 of pspsolver1.py
. parameter interpolation='none'
introduced sometime between matplotlib version 1.0.1 , 1.2.0.
so guess 2 machines running different versions of matplotlib, , 1 version not recent enough.
one way fix problem (of course) update older version of matplotlib. if not option or you'd rather not that, note the docs say:
if interpolation 'none', no interpolation performed on agg, ps , pdf backends. other backends fall ‘nearest’.
so, if not using agg
, ps
or pdf
backend, change line to
x_ax.imshow(xcolors, cmap=cmap, interpolation='nearest')
of course, if go route, there might other pieces of code use newer matplotlib features. might not easy fix.
Comments
Post a Comment