CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 1239 of file plotting.py.

Constructor & Destructor Documentation

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

Definition at line 1241 of file plotting.py.

1242  def __init__(self, pad, bounds, zmax, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None, ybinlabels=None):
1243  self._pad = pad
1244  self._frame = _drawFrame(pad, bounds, zmax, xbinlabels, xbinlabelsize, xbinlabeloption, ybinlabels)
1245 
1246  yoffsetFactor = 1
1247  xoffsetFactor = 1
1248  if nrows == 2:
1249  yoffsetFactor *= 2
1250  xoffsetFactor *= 2
1251  elif nrows >= 5:
1252  yoffsetFactor *= 1.5
1253  xoffsetFactor *= 1.5
1254  elif nrows >= 3:
1255  yoffsetFactor *= 4
1256  xoffsetFactor *= 3
1257 
1258  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
1259  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
1260 
def _drawFrame
Definition: plotting.py:1187

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1273 of file plotting.py.

1274  def adjustMarginLeft(self, adjust):
1275  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
1276  # Need to redraw frame after adjusting the margin
1277  self._pad.cd()
1278  self._frame.Draw("")
def adjustMarginLeft
Definition: plotting.py:1273
def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 1279 of file plotting.py.

1280  def adjustMarginRight(self, adjust):
1281  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
1282  # Need to redraw frame after adjusting the margin
1283  self._pad.cd()
1284  self._frame.Draw("")
def adjustMarginRight
Definition: plotting.py:1279
def plotting.Frame.redrawAxis (   self)

Definition at line 1309 of file plotting.py.

1310  def redrawAxis(self):
1311  self._pad.RedrawAxis()
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 1267 of file plotting.py.

1268  def setGridx(self, grid):
1269  self._pad.SetGridx(grid)
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 1270 of file plotting.py.

1271  def setGridy(self, grid):
1272  self._pad.SetGridy(grid)
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 1261 of file plotting.py.

1262  def setLogx(self, log):
1263  self._pad.SetLogx(log)
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 1264 of file plotting.py.

1265  def setLogy(self, log):
1266  self._pad.SetLogy(log)
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 1285 of file plotting.py.

1286  def setTitle(self, title):
1287  self._frame.SetTitle(title)
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 1297 of file plotting.py.

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

Definition at line 1288 of file plotting.py.

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

Definition at line 1294 of file plotting.py.

1295  def setXTitleOffset(self, offset):
1296  self._frame.GetXaxis().SetTitleOffset(offset)
def setXTitleOffset
Definition: plotting.py:1294
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 1291 of file plotting.py.

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

Definition at line 1300 of file plotting.py.

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

Definition at line 1306 of file plotting.py.

1307  def setYTitleOffset(self, offset):
1308  self._frame.GetYaxis().SetTitleOffset(offset)
def setYTitleOffset
Definition: plotting.py:1306
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 1303 of file plotting.py.

1304  def setYTitleSize(self, size):
1305  self._frame.GetYaxis().SetTitleSize(size)

Member Data Documentation

plotting.Frame._frame
private

Definition at line 1243 of file plotting.py.

plotting.Frame._pad
private

Definition at line 1242 of file plotting.py.