我正在尝试使用rootpy
制作一个简单的2D直方图示例。我得到的不是黑白彩色图,而是一半的黑白输出。有什么想法我做错了吗?
#!/usr/bin/env python
import rootpy.plotting as rpplt
from rootpy.interactive import wait
import numpy as np
nframes = 10
lframes = 20
h = rpplt.Hist2D(lframes, 0, lframes, nframes, 0, nframes,
name='my 2D hist',
title='Some Data',
)
zz = np.random.rand(nframes, lframes)
for jj in range(nframes):
for ii in range(lframes):
h.set_bin_content(jj, ii, zz[jj,ii])
c = rpplt.Canvas(width=700, height=500)
h.Draw()
wait()