CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
plotting.Frame Class Reference

Public Member Functions

def __init__ (self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None)
 
def adjustMarginLeft (self, adjust)
 
def adjustMarginRight (self, adjust)
 
def redrawAxis (self)
 
def setGridx (self, grid)
 
def setGridy (self, grid)
 
def setLogx (self, log)
 
def setLogy (self, log)
 
def setTitle (self, title)
 
def setXLabelSize (self, size)
 
def setXTitle (self, title)
 
def setXTitleOffset (self, offset)
 
def setXTitleSize (self, size)
 
def setYTitle (self, title)
 
def setYTitleOffset (self, offset)
 
def setYTitleSize (self, size)
 

Private Attributes

 _frame
 
 _pad
 

Detailed Description

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

Definition at line 1054 of file plotting.py.

Constructor & Destructor Documentation

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

Definition at line 1056 of file plotting.py.

1056  def __init__(self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None):
1057  self._pad = pad
1058  self._frame = _drawFrame(pad, bounds, xbinlabels, xbinlabelsize, xbinlabeloption)
1059 
1060  yoffsetFactor = 1
1061  xoffsetFactor = 1
1062  if nrows == 2:
1063  yoffsetFactor *= 2
1064  xoffsetFactor *= 2
1065  elif nrows >= 3:
1066  yoffsetFactor *= 4
1067  xoffsetFactor *= 3
1068 
1069  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
1070  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
1071 
1072 
def __init__(self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None)
Definition: plotting.py:1056
def _drawFrame(pad, bounds, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None, suffix="")
Definition: plotting.py:1018

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1085 of file plotting.py.

1085  def adjustMarginLeft(self, adjust):
1086  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
1087  # Need to redraw frame after adjusting the margin
1088  self._pad.cd()
1089  self._frame.Draw("")
1090 
def adjustMarginLeft(self, adjust)
Definition: plotting.py:1085
def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 1091 of file plotting.py.

1091  def adjustMarginRight(self, adjust):
1092  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
1093  # Need to redraw frame after adjusting the margin
1094  self._pad.cd()
1095  self._frame.Draw("")
1096 
def adjustMarginRight(self, adjust)
Definition: plotting.py:1091
def plotting.Frame.redrawAxis (   self)

Definition at line 1121 of file plotting.py.

1121  def redrawAxis(self):
1122  self._pad.RedrawAxis()
1123 
def redrawAxis(self)
Definition: plotting.py:1121
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 1079 of file plotting.py.

1079  def setGridx(self, grid):
1080  self._pad.SetGridx(grid)
1081 
def setGridx(self, grid)
Definition: plotting.py:1079
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 1082 of file plotting.py.

1082  def setGridy(self, grid):
1083  self._pad.SetGridy(grid)
1084 
def setGridy(self, grid)
Definition: plotting.py:1082
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 1073 of file plotting.py.

1073  def setLogx(self, log):
1074  self._pad.SetLogx(log)
1075 
def setLogx(self, log)
Definition: plotting.py:1073
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 1076 of file plotting.py.

1076  def setLogy(self, log):
1077  self._pad.SetLogy(log)
1078 
def setLogy(self, log)
Definition: plotting.py:1076
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 1097 of file plotting.py.

1097  def setTitle(self, title):
1098  self._frame.SetTitle(title)
1099 
def setTitle(self, title)
Definition: plotting.py:1097
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 1109 of file plotting.py.

1109  def setXLabelSize(self, size):
1110  self._frame.GetXaxis().SetLabelSize(size)
1111 
def setXLabelSize(self, size)
Definition: plotting.py:1109
def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 1100 of file plotting.py.

1100  def setXTitle(self, title):
1101  self._frame.GetXaxis().SetTitle(title)
1102 
def setXTitle(self, title)
Definition: plotting.py:1100
def plotting.Frame.setXTitleOffset (   self,
  offset 
)

Definition at line 1106 of file plotting.py.

1106  def setXTitleOffset(self, offset):
1107  self._frame.GetXaxis().SetTitleOffset(offset)
1108 
def setXTitleOffset(self, offset)
Definition: plotting.py:1106
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 1103 of file plotting.py.

1103  def setXTitleSize(self, size):
1104  self._frame.GetXaxis().SetTitleSize(size)
1105 
def setXTitleSize(self, size)
Definition: plotting.py:1103
def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 1112 of file plotting.py.

1112  def setYTitle(self, title):
1113  self._frame.GetYaxis().SetTitle(title)
1114 
def setYTitle(self, title)
Definition: plotting.py:1112
def plotting.Frame.setYTitleOffset (   self,
  offset 
)

Definition at line 1118 of file plotting.py.

1118  def setYTitleOffset(self, offset):
1119  self._frame.GetYaxis().SetTitleOffset(offset)
1120 
def setYTitleOffset(self, offset)
Definition: plotting.py:1118
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 1115 of file plotting.py.

1115  def setYTitleSize(self, size):
1116  self._frame.GetYaxis().SetTitleSize(size)
1117 
def setYTitleSize(self, size)
Definition: plotting.py:1115

Member Data Documentation

plotting.Frame._frame
private

Definition at line 1058 of file plotting.py.

plotting.Frame._pad
private

Definition at line 1057 of file plotting.py.