I have a simple script to test a plot in matplotlib but no window showing the figure appears. On reading other questions on stackoverflow, I've done the following to resolve this:
- installed PySide using these instructions.
edited matplotlibrc file with these two lines:
backend : Qt4Agg #backend.qt4 : PySide # PyQt4 | PySide
so that the command
python -c 'import matplotlib; import matplotlib.pyplot; print(matplotlib.backends.backend)'
now yieldsQt4Agg
whereas before it gaveagg
included the
pylab.show()
command. So the set of commands that I now tried in the python interpreter after installing Pyside, and editing the matplotlibrc file look like this:import pylab pylab.ion() import matplotlib.pyplot as plt import numpy as np x = np.arange(0,5,0.1) y = np.sin(x) plt.plot(x,y) [<matplotlib.lines.Line2D object at 0x7fcef627cdd0>] pylab.show()
However, the plot still doesn't show. Could anyone please help me with this? I am using Ubuntu 14.04 in VirtualBox with python2.7.