ExcelPlotter.Excel Class Reference

Public Member Functions

def __init__ (self)
 
def plot (self, h)
 

Public Attributes

 ex
 
 wb
 
 ws
 
 ch
 
 ser
 

Detailed Description

Definition at line 4 of file ExcelPlotter.py.

Constructor & Destructor Documentation

def ExcelPlotter.Excel.__init__ (   self)

Definition at line 5 of file ExcelPlotter.py.

5  def __init__(self):
6  self.ex = win32com.client.Dispatch('Excel.Application')
7  self.wb = self.ex.Workbooks.Add()
8  self.ws = self.wb.WorkSheets.Add()
9  self.ws.Name = 'HistoData'
10  self.ch = self.wb.Charts.Add()
11  self.ch.Name = 'HistoPlot'
def __init__(self)
Definition: ExcelPlotter.py:5

Member Function Documentation

def ExcelPlotter.Excel.plot (   self,
  h 
)

Definition at line 12 of file ExcelPlotter.py.

12  def plot(self, h):
13  self.ex.Visible = 0
14  heights = h.heights()
15  nbin = len(heights)
16  xmin, xmax = h.edges()
17  for i in range(nbin) :
18  self.ws.Cells(i+1,1).value = heights[i]
19  self.ws.Cells(i+1,2).value = xmin + i*(xmax-xmin)/nbin
20  self.ch.SetSourceData(self.ws.Range(self.ws.Cells(1,1), self.ws.Cells(nbin+1,1)))
21  self.ch.HasTitle = 1
22  self.ch.ChartTitle.Text = h.title()
23  self.ser = self.ch.SeriesCollection(1)
24  self.ser.XValues = self.ws.Range(self.ws.Cells(1,2), self.ws.Cells(nbin+1,2))
25  self.ex.Visible = 1
26 
def plot(self, h)
Definition: ExcelPlotter.py:12
NamedRange_< CONTAINER > range(const CONTAINER &cnt, const std::string &name)
simple function to create the named range form arbitrary container
Definition: NamedRange.h:133

Member Data Documentation

ExcelPlotter.Excel.ch

Definition at line 10 of file ExcelPlotter.py.

ExcelPlotter.Excel.ex

Definition at line 6 of file ExcelPlotter.py.

ExcelPlotter.Excel.ser

Definition at line 23 of file ExcelPlotter.py.

ExcelPlotter.Excel.wb

Definition at line 7 of file ExcelPlotter.py.

ExcelPlotter.Excel.ws

Definition at line 8 of file ExcelPlotter.py.


The documentation for this class was generated from the following file: