All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ExcelPlotter.Excel Class Reference

Public Member Functions

def __init__
 
def plot
 

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 
6  def __init__(self):
7  self.ex = win32com.client.Dispatch('Excel.Application')
8  self.wb = self.ex.Workbooks.Add()
9  self.ws = self.wb.WorkSheets.Add()
10  self.ws.Name = 'HistoData'
11  self.ch = self.wb.Charts.Add()
self.ch.Name = 'HistoPlot'

Member Function Documentation

def ExcelPlotter.Excel.plot (   self,
  h 
)

Definition at line 12 of file ExcelPlotter.py.

12 
13  def plot(self, h):
14  self.ex.Visible = 0
15  heights = h.heights()
16  nbin = len(heights)
17  xmin, xmax = h.edges()
18  for i in range(nbin) :
19  self.ws.Cells(i+1,1).value = heights[i]
20  self.ws.Cells(i+1,2).value = xmin + i*(xmax-xmin)/nbin
21  self.ch.SetSourceData(self.ws.Range(self.ws.Cells(1,1), self.ws.Cells(nbin+1,1)))
22  self.ch.HasTitle = 1
23  self.ch.ChartTitle.Text = h.title()
24  self.ser = self.ch.SeriesCollection(1)
25  self.ser.XValues = self.ws.Range(self.ws.Cells(1,2), self.ws.Cells(nbin+1,2))
26  self.ex.Visible = 1
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: