I found I can not draw figure using PyCall in IJulia, but draw in Julia
console is OK. The PyPlot is also work. In my work I have to use many
python package to draw figures, and I hope the figure could be shown in
IJulia. Is there any way to solve this error?
I put the error message below:
julia> @pyimport matplotlib.pyplot as pplot
julia> pplot.plot(1:4,1:4)
PyError (PyObject_Call) <type 'exceptions.RuntimeError'>
RuntimeError('Invalid DISPLAY variable',)
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 2980, in plot
ax = gca()
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 803, in gca
ax = gcf().gca(**kwargs)
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py",
line 423, in figure
**kwargs)
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py",
line 31, in new_figure_manager
return new_figure_manager_given_figure(num, thisFig)
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py",
line 38, in new_figure_manager_given_figure
canvas = FigureCanvasQTAgg(figure)
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py",
line 70, in __init__
FigureCanvasQT.__init__( self, figure )
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py",
line 207, in __init__
_create_qApp()
File
"/home/UserDir/programs/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py",
line 62, in _create_qApp
raise RuntimeError('Invalid DISPLAY variable')
while loading In[25], in expression starting on line 1
in pyerr_check at /home/UserDir/.julia/v0.4/PyCall/src/exception.jl:58
in pycall at /home/UserDir/.julia/v0.4/PyCall/src/PyCall.jl:85
in fn at /home/UserDir/.julia/v0.4/PyCall/src/conversions.jl:181