rootpy와 matplotlib로 ROOT 2D 히스토그램을 플롯하려고합니다.rootpy와 matplotlib로 2D 히스토그램의 플롯
그러나from rootpy.io import File
from rootpy.plotting import Hist
import rootpy.plotting.root2matplotlib as rplt
import matplotlib.pyplot as plt
inputFile = File('mydata.root', 'read')
h_response = inputFile.myfolder.response
plt.figure(figsize=(16, 10), dpi=100)
rplt.hist(h_response, label='response matrix')
h_response.Draw()
plt.xlabel('reconstructed $E_{\mathrm{T}}^{miss}$')
plt.ylabel('Generated $E_{\mathrm{T}}^{miss}$')
plt.title('Response Matrix')
plt.savefig('ResponseMatrix.png')
, 이것은 오류 MSG 나에게 잎 :
나는이에 사용하는 코드는
Traceback (most recent call last):
File "/storage/Dropbox/Workspace/Analysis/DailyPythonScripts/src/unfolding.py", line 66, in <module>
rplt.hist(h_response, label='response matrix')
File "/usr/local/lib/python2.7/dist-packages/rootpy-0.7.0_a0-py2.7-linux-x86_64.egg/rootpy/plotting/root2matplotlib.py", line 140, in hist
snap_zero=snap_zero)
File "/usr/local/lib/python2.7/dist-packages/rootpy-0.7.0_a0-py2.7-linux-x86_64.egg/rootpy/plotting/root2matplotlib.py", line 82, in _set_bounds
ywidth = ymax - ymin
TypeError: unsupported operand type(s) for -: 'list' and 'list'
분명히
내가 잘못 rootpy2matplotlib 모듈을 사용하고, 그래서보고했다 : 모듈은 hist, bar 및 errorbar 기능을 제공합니다. -> 2D에 해당하지 않습니다.
내가 누락 된 항목이 있습니까? 쉬운 해결 방법이 있습니까?
추신 : 나는이 질문에 'rootpy'태그로 태그를 지정하고 싶습니다. 그러나 불가능합니다. 이 질문은 매우 구체적이기 때문에 사과드립니다.
대단히 감사합니다! – DragonTux