test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
plotting.Frame Class Reference

Public Member Functions

def __init__
 
def adjustMarginLeft
 
def adjustMarginRight
 
def redrawAxis
 
def setGridx
 
def setGridy
 
def setLogx
 
def setLogy
 
def setTitle
 
def setXLabelSize
 
def setXTitle
 
def setXTitleOffset
 
def setXTitleSize
 
def setYTitle
 
def setYTitleOffset
 
def setYTitleSize
 

Private Attributes

 _frame
 
 _pad
 

Detailed Description

Class for creating and managing a frame for a simple, one-pad plot

Definition at line 592 of file plotting.py.

Constructor & Destructor Documentation

def plotting.Frame.__init__ (   self,
  pad,
  bounds,
  nrows,
  xbinlabels = None,
  xbinlabelsize = None,
  xbinlabeloption = None 
)

Definition at line 594 of file plotting.py.

595  def __init__(self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None):
596  self._pad = pad
597  self._frame = _drawFrame(pad, bounds, xbinlabels, xbinlabelsize, xbinlabeloption)
598 
599  yoffsetFactor = 1
600  xoffsetFactor = 1
601  if nrows == 2:
602  yoffsetFactor *= 2
603  xoffsetFactor *= 2
604  elif nrows >= 3:
605  yoffsetFactor *= 4
606  xoffsetFactor *= 3
607 
608  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
609  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
610 
def _drawFrame
Definition: plotting.py:556

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 623 of file plotting.py.

624  def adjustMarginLeft(self, adjust):
625  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
626  # Need to redraw frame after adjusting the margin
627  self._pad.cd()
628  self._frame.Draw("")
def adjustMarginLeft
Definition: plotting.py:623
def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 629 of file plotting.py.

630  def adjustMarginRight(self, adjust):
631  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
632  # Need to redraw frame after adjusting the margin
633  self._pad.cd()
634  self._frame.Draw("")
def adjustMarginRight
Definition: plotting.py:629
def plotting.Frame.redrawAxis (   self)

Definition at line 659 of file plotting.py.

660  def redrawAxis(self):
661  self._pad.RedrawAxis()
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 617 of file plotting.py.

618  def setGridx(self, grid):
619  self._pad.SetGridx(grid)
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 620 of file plotting.py.

621  def setGridy(self, grid):
622  self._pad.SetGridy(grid)
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 611 of file plotting.py.

612  def setLogx(self, log):
613  self._pad.SetLogx(log)
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 614 of file plotting.py.

615  def setLogy(self, log):
616  self._pad.SetLogy(log)
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 635 of file plotting.py.

636  def setTitle(self, title):
637  self._frame.SetTitle(title)
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 647 of file plotting.py.

648  def setXLabelSize(self, size):
649  self._frame.GetXaxis().SetLabelSize(size)
def setXLabelSize
Definition: plotting.py:647
def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 638 of file plotting.py.

639  def setXTitle(self, title):
640  self._frame.GetXaxis().SetTitle(title)
def plotting.Frame.setXTitleOffset (   self,
  offset 
)

Definition at line 644 of file plotting.py.

645  def setXTitleOffset(self, offset):
646  self._frame.GetXaxis().SetTitleOffset(offset)
def setXTitleOffset
Definition: plotting.py:644
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 641 of file plotting.py.

642  def setXTitleSize(self, size):
643  self._frame.GetXaxis().SetTitleSize(size)
def setXTitleSize
Definition: plotting.py:641
def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 650 of file plotting.py.

651  def setYTitle(self, title):
652  self._frame.GetYaxis().SetTitle(title)
def plotting.Frame.setYTitleOffset (   self,
  offset 
)

Definition at line 656 of file plotting.py.

657  def setYTitleOffset(self, offset):
658  self._frame.GetYaxis().SetTitleOffset(offset)
def setYTitleOffset
Definition: plotting.py:656
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 653 of file plotting.py.

654  def setYTitleSize(self, size):
655  self._frame.GetYaxis().SetTitleSize(size)
def setYTitleSize
Definition: plotting.py:653

Member Data Documentation

plotting.Frame._frame
private

Definition at line 596 of file plotting.py.

plotting.Frame._pad
private

Definition at line 595 of file plotting.py.