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 1036 of file plotting.py.

Constructor & Destructor Documentation

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

Definition at line 1038 of file plotting.py.

1039  def __init__(self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None):
1040  self._pad = pad
1041  self._frame = _drawFrame(pad, bounds, xbinlabels, xbinlabelsize, xbinlabeloption)
1042 
1043  yoffsetFactor = 1
1044  xoffsetFactor = 1
1045  if nrows == 2:
1046  yoffsetFactor *= 2
1047  xoffsetFactor *= 2
1048  elif nrows >= 3:
1049  yoffsetFactor *= 4
1050  xoffsetFactor *= 3
1051 
1052  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
1053  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
1054 
def _drawFrame
Definition: plotting.py:1000

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1067 of file plotting.py.

1068  def adjustMarginLeft(self, adjust):
1069  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
1070  # Need to redraw frame after adjusting the margin
1071  self._pad.cd()
1072  self._frame.Draw("")
def adjustMarginLeft
Definition: plotting.py:1067
def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 1073 of file plotting.py.

1074  def adjustMarginRight(self, adjust):
1075  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
1076  # Need to redraw frame after adjusting the margin
1077  self._pad.cd()
1078  self._frame.Draw("")
def adjustMarginRight
Definition: plotting.py:1073
def plotting.Frame.redrawAxis (   self)

Definition at line 1103 of file plotting.py.

1104  def redrawAxis(self):
1105  self._pad.RedrawAxis()
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 1061 of file plotting.py.

1062  def setGridx(self, grid):
1063  self._pad.SetGridx(grid)
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 1064 of file plotting.py.

1065  def setGridy(self, grid):
1066  self._pad.SetGridy(grid)
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 1055 of file plotting.py.

1056  def setLogx(self, log):
1057  self._pad.SetLogx(log)
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 1058 of file plotting.py.

1059  def setLogy(self, log):
1060  self._pad.SetLogy(log)
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 1079 of file plotting.py.

1080  def setTitle(self, title):
1081  self._frame.SetTitle(title)
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 1091 of file plotting.py.

1092  def setXLabelSize(self, size):
1093  self._frame.GetXaxis().SetLabelSize(size)
def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 1082 of file plotting.py.

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

Definition at line 1088 of file plotting.py.

1089  def setXTitleOffset(self, offset):
1090  self._frame.GetXaxis().SetTitleOffset(offset)
def setXTitleOffset
Definition: plotting.py:1088
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 1085 of file plotting.py.

1086  def setXTitleSize(self, size):
1087  self._frame.GetXaxis().SetTitleSize(size)
def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 1094 of file plotting.py.

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

Definition at line 1100 of file plotting.py.

1101  def setYTitleOffset(self, offset):
1102  self._frame.GetYaxis().SetTitleOffset(offset)
def setYTitleOffset
Definition: plotting.py:1100
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 1097 of file plotting.py.

1098  def setYTitleSize(self, size):
1099  self._frame.GetYaxis().SetTitleSize(size)

Member Data Documentation

plotting.Frame._frame
private

Definition at line 1040 of file plotting.py.

plotting.Frame._pad
private

Definition at line 1039 of file plotting.py.