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

Constructor & Destructor Documentation

◆ __init__()

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.

1241  def __init__(self, pad, bounds, zmax, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None, ybinlabels=None):
1242  self._pad = pad
1243  self._frame = _drawFrame(pad, bounds, zmax, xbinlabels, xbinlabelsize, xbinlabeloption, ybinlabels)
1244 
1245  yoffsetFactor = 1
1246  xoffsetFactor = 1
1247  if nrows == 2:
1248  yoffsetFactor *= 2
1249  xoffsetFactor *= 2
1250  elif nrows >= 5:
1251  yoffsetFactor *= 1.5
1252  xoffsetFactor *= 1.5
1253  elif nrows >= 3:
1254  yoffsetFactor *= 4
1255  xoffsetFactor *= 3
1256 
1257  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
1258  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
1259 
1260 
def _drawFrame(pad, bounds, zmax=None, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None, ybinlabels=None, suffix="")
Definition: plotting.py:1187
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ adjustMarginLeft()

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1273 of file plotting.py.

References plotting.Frame._frame, plotting.Frame._pad, and hippyaddtobaddatafiles.cd().

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

◆ adjustMarginRight()

def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 1279 of file plotting.py.

References plotting.Frame._frame, plotting.Frame._pad, and hippyaddtobaddatafiles.cd().

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

◆ redrawAxis()

def plotting.Frame.redrawAxis (   self)

Definition at line 1309 of file plotting.py.

References plotting.Frame._pad.

1309  def redrawAxis(self):
1310  self._pad.RedrawAxis()
1311 

◆ setGridx()

def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 1267 of file plotting.py.

References plotting.Frame._pad.

1267  def setGridx(self, grid):
1268  self._pad.SetGridx(grid)
1269 

◆ setGridy()

def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 1270 of file plotting.py.

References plotting.Frame._pad.

1270  def setGridy(self, grid):
1271  self._pad.SetGridy(grid)
1272 

◆ setLogx()

def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 1261 of file plotting.py.

References plotting.Frame._pad.

1261  def setLogx(self, log):
1262  self._pad.SetLogx(log)
1263 

◆ setLogy()

def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 1264 of file plotting.py.

References plotting.Frame._pad.

1264  def setLogy(self, log):
1265  self._pad.SetLogy(log)
1266 

◆ setTitle()

def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 1285 of file plotting.py.

References plotting.Frame._frame.

1285  def setTitle(self, title):
1286  self._frame.SetTitle(title)
1287 

◆ setXLabelSize()

def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 1297 of file plotting.py.

References plotting.Frame._frame.

1297  def setXLabelSize(self, size):
1298  self._frame.GetXaxis().SetLabelSize(size)
1299 

◆ setXTitle()

def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 1288 of file plotting.py.

References plotting.Frame._frame.

1288  def setXTitle(self, title):
1289  self._frame.GetXaxis().SetTitle(title)
1290 

◆ setXTitleOffset()

def plotting.Frame.setXTitleOffset (   self,
  offset 
)

Definition at line 1294 of file plotting.py.

References plotting.Frame._frame.

1294  def setXTitleOffset(self, offset):
1295  self._frame.GetXaxis().SetTitleOffset(offset)
1296 

◆ setXTitleSize()

def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 1291 of file plotting.py.

References plotting.Frame._frame.

1291  def setXTitleSize(self, size):
1292  self._frame.GetXaxis().SetTitleSize(size)
1293 

◆ setYTitle()

def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 1300 of file plotting.py.

References plotting.Frame._frame.

1300  def setYTitle(self, title):
1301  self._frame.GetYaxis().SetTitle(title)
1302 

◆ setYTitleOffset()

def plotting.Frame.setYTitleOffset (   self,
  offset 
)

Definition at line 1306 of file plotting.py.

References plotting.Frame._frame.

1306  def setYTitleOffset(self, offset):
1307  self._frame.GetYaxis().SetTitleOffset(offset)
1308 

◆ setYTitleSize()

def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 1303 of file plotting.py.

References plotting.Frame._frame.

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

Member Data Documentation

◆ _frame

plotting.Frame._frame
private

◆ _pad

plotting.Frame._pad
private