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, zmax, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None, ybinlabels=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 1235 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 1237 of file plotting.py.

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

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1269 of file plotting.py.

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

Definition at line 1275 of file plotting.py.

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

Definition at line 1305 of file plotting.py.

1305  def redrawAxis(self):
1306  self._pad.RedrawAxis()
1307 
def redrawAxis(self)
Definition: plotting.py:1305
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 1263 of file plotting.py.

1263  def setGridx(self, grid):
1264  self._pad.SetGridx(grid)
1265 
def setGridx(self, grid)
Definition: plotting.py:1263
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 1266 of file plotting.py.

1266  def setGridy(self, grid):
1267  self._pad.SetGridy(grid)
1268 
def setGridy(self, grid)
Definition: plotting.py:1266
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 1257 of file plotting.py.

1257  def setLogx(self, log):
1258  self._pad.SetLogx(log)
1259 
def setLogx(self, log)
Definition: plotting.py:1257
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 1260 of file plotting.py.

1260  def setLogy(self, log):
1261  self._pad.SetLogy(log)
1262 
def setLogy(self, log)
Definition: plotting.py:1260
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 1281 of file plotting.py.

1281  def setTitle(self, title):
1282  self._frame.SetTitle(title)
1283 
def setTitle(self, title)
Definition: plotting.py:1281
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 1293 of file plotting.py.

1293  def setXLabelSize(self, size):
1294  self._frame.GetXaxis().SetLabelSize(size)
1295 
def setXLabelSize(self, size)
Definition: plotting.py:1293
def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 1284 of file plotting.py.

1284  def setXTitle(self, title):
1285  self._frame.GetXaxis().SetTitle(title)
1286 
def setXTitle(self, title)
Definition: plotting.py:1284
def plotting.Frame.setXTitleOffset (   self,
  offset 
)

Definition at line 1290 of file plotting.py.

1290  def setXTitleOffset(self, offset):
1291  self._frame.GetXaxis().SetTitleOffset(offset)
1292 
def setXTitleOffset(self, offset)
Definition: plotting.py:1290
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 1287 of file plotting.py.

1287  def setXTitleSize(self, size):
1288  self._frame.GetXaxis().SetTitleSize(size)
1289 
def setXTitleSize(self, size)
Definition: plotting.py:1287
def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 1296 of file plotting.py.

1296  def setYTitle(self, title):
1297  self._frame.GetYaxis().SetTitle(title)
1298 
def setYTitle(self, title)
Definition: plotting.py:1296
def plotting.Frame.setYTitleOffset (   self,
  offset 
)

Definition at line 1302 of file plotting.py.

1302  def setYTitleOffset(self, offset):
1303  self._frame.GetYaxis().SetTitleOffset(offset)
1304 
def setYTitleOffset(self, offset)
Definition: plotting.py:1302
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 1299 of file plotting.py.

1299  def setYTitleSize(self, size):
1300  self._frame.GetYaxis().SetTitleSize(size)
1301 
def setYTitleSize(self, size)
Definition: plotting.py:1299

Member Data Documentation

plotting.Frame._frame
private

Definition at line 1239 of file plotting.py.

plotting.Frame._pad
private

Definition at line 1238 of file plotting.py.