18 import matplotlib.patches
as patches
19 from matplotlib.path
import Path
20 import matplotlib.pyplot
as plt
29 wx.Panel.__init__(self, parent, id=-1)
31 self.
figure = plt.figure(figid)
32 self.
figure.subplots_adjust(top=0.9,bottom=0.05,right=0.95,left=0.05)
36 sizer = wx.BoxSizer(wx.VERTICAL)
37 sizer.Add(self.
canvas,1,wx.EXPAND)
38 sizer.Add(self.
toolbar, 0 , wx.LEFT | wx.EXPAND)
53 left=np.array(histo.edges()[:-1])
54 right=np.array(histo.edges()[1:])
55 bottom = np.zeros(len(left))
56 top=bottom+histo.bins()
58 nverts = nrects*(1+3+1)
59 verts = np.zeros((nverts, 2))
60 codes = np.ones(nverts, int) * Path.LINETO
61 codes[0::5] = Path.MOVETO
62 codes[4::5] = Path.CLOSEPOLY
64 verts[0::5,1] = bottom
70 verts[3::5,1] = bottom
71 barpath = Path(verts, codes)
72 patch = patches.PathPatch(barpath,
79 fig.set_xlim(histo.minX(), histo.maxX())
81 fig.set_ylim(0.,max*1.05)
83 fig.set_ylim(max*1.05,0.)
def __init__(self, parent, figid)
def h1d(fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')