I am Ubuntu 16.04 terminal, python 2.7 ,matplotlib.
I need to run python script “demo.py” ,which should display image
I check my backend using
>>>import matplotlib
>>>matplotlib.get_backend()
'TkAgg'
I put
matplotlib.use('Agg')
because otherwise it was giving me an error
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1818, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
I also put
plt.imshow(im)
plt.show()
but it doesn’t work
please let me know how can I see the image on my ubuntu terminal using
python demo1.py