Cat
Classes | Functions
plotter Namespace Reference

Classes

class  plotter
 

Functions

def h1d (fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')
 

Function Documentation

◆ h1d()

def plotter.h1d (   fig,
  histo,
  alpha = 0.5,
  facecolor = 'green',
  edgecolor = 'yellow',
  linestyle = 'dashed' 
)

Definition at line 51 of file plotter.py.

Referenced by plotter.plotter.destroy(), A3PE_BitFlip.Plot(), StorageFifoAcquisition.Plot(), StorageFifo.Plot(), TestSuite.Plot(), TestI2C.Plot(), TestSPI.Plot(), TestUSB.Plot(), and Acquisition.Plot().

51  linestyle='dashed'):
52  import numpy as np
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()
57  nrects=len(left)
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
63  verts[0::5,0] = left
64  verts[0::5,1] = bottom
65  verts[1::5,0] = left
66  verts[1::5,1] = top
67  verts[2::5,0] = right
68  verts[2::5,1] = top
69  verts[3::5,0] = right
70  verts[3::5,1] = bottom
71  barpath = Path(verts, codes)
72  patch = patches.PathPatch(barpath,
73  facecolor=facecolor,
74  edgecolor=edgecolor,
75  alpha=alpha,
76  linestyle=linestyle)
77  max=histo.maxY()
78  fig.add_patch(patch)
79  fig.set_xlim(histo.minX(), histo.maxX())
80  if (max>0):
81  fig.set_ylim(0.,max*1.05)
82  else:
83  fig.set_ylim(max*1.05,0.)
84 
87 
88