Cat
Functions
TestSuite Namespace Reference

Functions

def Edit (cat, obj, panel, path)
 
def createPlots (cat, obj, run)
 
def updatePlots (figs, obj)
 
def Plot (cat, obj, parent, id)
 

Function Documentation

◆ createPlots()

def TestSuite.createPlots (   cat,
  obj,
  run 
)

Definition at line 46 of file TestSuite.py.

46 def createPlots(cat, obj, run):
47  fig = plt.figure(figsize=(10,10))
48  fig.suptitle("Run "+str(run), fontsize=14, fontweight='bold')
49  for vplot in [1,2,3]:
50  ax = fig.add_subplot(3,1,vplot)
51  fig.show()
52  return [fig]
53 
def createPlots(cat, obj, run)
Definition: TestSuite.py:46

◆ Edit()

def TestSuite.Edit (   cat,
  obj,
  panel,
  path 
)

Definition at line 41 of file TestSuite.py.

41 def Edit (cat, obj, panel, path):
42  return TestSuite(cat, obj, panel, path)
43 
44 #----------------------------------------------------------------------
45 
def Edit(cat, obj, panel, path)
Definition: TestSuite.py:41

◆ Plot()

def TestSuite.Plot (   cat,
  obj,
  parent,
  id 
)

Definition at line 83 of file TestSuite.py.

References plotter.h1d(), Object.name(), and Object.title().

83 def Plot(cat, obj, parent, id):
84  from mpl_toolkits.mplot3d import Axes3D
85  from matplotlib import cm
86  import matplotlib as mpl
87  import matplotlib.pyplot as plt
88  import numpy as np
89 
90  plot=plotter(parent,id)
91  fig=plot.current()
92  fig.suptitle('TestSuite - Plot capabilities', fontsize=14, fontweight='bold')
93 
94  # plot of data set 0
95  p1=fig.add_subplot(2,3,1)
96  p1.plot(obj.data(0), 'bo', obj.data().vector(1),'k')
97  p1.set_title(r'$\sigma_0='+str(obj.sigma(0))+'$')
98 
99  # plot of data set 1
100  p2=fig.add_subplot(2,3,2)
101  p2.plot(obj.data(1), 'r--')
102  p2.set_title(r'$\sigma_1='+str(obj.sigma(1))+'$')
103 
104  # plot of data set 0 (histogram)
105  plt.subplot(2,3,3)
106  n, bins, h=plt.hist(obj.data().vector(0), 10)
107  plt.title(obj.data().title(0))
108  plt.grid(True)
109 
110  # plot of data set 1 (histogram)
111  plt.subplot(2,3,4)
112  plt.hist(obj.data().vector(1), 20)
113  plt.title(obj.data().name(1)+" : "+obj.data().title(1))
114  plt.grid(True)
115 
116  # plot histo root
117  p5=fig.add_subplot(2,3,5)
118  h1=h1d(p5, obj.hist1d(0), facecolor='red',linestyle='dashed')
119  p5.grid(True)
120 
def Plot(cat, obj, parent, id)
Definition: TestSuite.py:83
def h1d(fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')
Definition: plotter.py:51

◆ updatePlots()

def TestSuite.updatePlots (   figs,
  obj 
)

Definition at line 54 of file TestSuite.py.

54 def updatePlots(figs, obj):
55  fig = figs[0]
56  ax1 = fig.add_subplot(3,1,1)
57  lines, = ax1.plot([],[], 'bo')
58  #Autoscale on unknown axis and known lims on the other
59  ax1.set_autoscaley_on(True)
60 # ax.set_xlim(self.min_x, self.max_x)
61  #Other stuff
62  ax1.grid()
63  lines.set_xdata(obj.data(0))
64  lines.set_ydata(obj.data(1))
65  #Need both of these in order to rescale
66  ax1.relim()
67  ax1.autoscale_view()
68 
69  # plot histo root
70  ax2=fig.add_subplot(3,1,2)
71  h1 = ax2.hist(obj.data(0))
72  ax2.relim()
73  ax2.autoscale_view()
74 
75  #We need to draw *and* flush
76  fig.canvas.draw()
77  fig.canvas.flush_events()
78  fig.show()
79  return fig
80 
81 #----------------------------------------------------------------------
82 
def updatePlots(figs, obj)
Definition: TestSuite.py:54