Hi everyone,
I am having some trouble using rootpy over SSH. It only happens intermittently so I am having real trouble working out what the problem is. My function starts off with:
def PtDifferential(InputCentral, InputHalf, InputDouble):
import ROOT
import numpy as np
import sys
import rootpy
from rootpy.plotting import Hist, HistStack, Legend, Canvas
from rootpy.plotting.style import get_style, set_style
from rootpy.interactive import wait
from rootpy import asrootpy
import rootpy.plotting.root2matplotlib as rplt
....
and then goes on to manipulate some histograms eventually saving them to *.pdf files. But sometimes I get the following error:
DISPLAY not set, setting it to t050.ph.ed.ac.uk:0.0
WARNING:rootpy.interactive.rootwait] unable to access ROOT’s GUI thread either because PyROOT’s finalSetup() was called while in batch mode or because PyROOT is using the new PyOS_InputHook based mechanism that is not yet supported in rootpy (PyConfig.StartGuiThread == ‘inputhook’ or gSystem.InheritsFrom(‘TMacOSXSystem’)). wait() etc. will instead call raw_input() and wait for [Enter]
Traceback (most recent call last):
File “Analysis.py”, line 1217, in
PtDifferential(“LatestShowered”, “ShowwerHalf3”, “ShowwerDouble3”)
File “Analysis.py”, line 840, in PtDifferential
fig = plt.figure(figsize = (7, 5), dpi = 100, facecolor = ‘white’)
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/pyplot.py”, line 423, in figure
**kwargs)
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py”, line 31, in new_figure_manager
return new_figure_manager_given_figure(num, thisFig)
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py”, line 38, in new_figure_manager_given_figure
canvas = FigureCanvasQTAgg(figure)
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_qt4agg.py”, line 70, in init
FigureCanvasQT.init( self, figure )
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_qt4.py”, line 207, in init
_create_qApp()
File “/Home/s1231192/.local/lib/python2.6/site-packages/matplotlib-1.3.0-py2.6-linux-x86_64.egg/matplotlib/backends/backend_qt4.py”, line 62, in _create_qApp
raise RuntimeError(‘Invalid DISPLAY variable’)
RuntimeError: Invalid DISPLAY variable
Any help would be greatly appreciated. Thanks
Jack