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

Constructor & Destructor Documentation

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

Definition at line 475 of file plotting.py.

476  def __init__(self, pad, bounds, nrows, xbinlabels=None, xbinlabelsize=None, xbinlabeloption=None):
477  self._pad = pad
478  self._frame = _drawFrame(pad, bounds, xbinlabels, xbinlabelsize, xbinlabeloption)
479 
480  yoffsetFactor = 1
481  xoffsetFactor = 1
482  if nrows == 2:
483  yoffsetFactor *= 2
484  xoffsetFactor *= 2
485  elif nrows >= 3:
486  yoffsetFactor *= 4
487  xoffsetFactor *= 3
488 
489  self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
490  self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
491 
def _drawFrame
Definition: plotting.py:437

Member Function Documentation

def plotting.Frame.adjustMarginLeft (   self,
  adjust 
)

Definition at line 504 of file plotting.py.

505  def adjustMarginLeft(self, adjust):
506  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
507  # Need to redraw frame after adjusting the margin
508  self._pad.cd()
509  self._frame.Draw("")
def adjustMarginLeft
Definition: plotting.py:504
def plotting.Frame.adjustMarginRight (   self,
  adjust 
)

Definition at line 510 of file plotting.py.

511  def adjustMarginRight(self, adjust):
512  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
513  # Need to redraw frame after adjusting the margin
514  self._pad.cd()
515  self._frame.Draw("")
def adjustMarginRight
Definition: plotting.py:510
def plotting.Frame.redrawAxis (   self)

Definition at line 540 of file plotting.py.

541  def redrawAxis(self):
542  self._pad.RedrawAxis()
def plotting.Frame.setGridx (   self,
  grid 
)

Definition at line 498 of file plotting.py.

499  def setGridx(self, grid):
500  self._pad.SetGridx(grid)
def plotting.Frame.setGridy (   self,
  grid 
)

Definition at line 501 of file plotting.py.

502  def setGridy(self, grid):
503  self._pad.SetGridy(grid)
def plotting.Frame.setLogx (   self,
  log 
)

Definition at line 492 of file plotting.py.

493  def setLogx(self, log):
494  self._pad.SetLogx(log)
def plotting.Frame.setLogy (   self,
  log 
)

Definition at line 495 of file plotting.py.

496  def setLogy(self, log):
497  self._pad.SetLogy(log)
def plotting.Frame.setTitle (   self,
  title 
)

Definition at line 516 of file plotting.py.

517  def setTitle(self, title):
518  self._frame.SetTitle(title)
def plotting.Frame.setXLabelSize (   self,
  size 
)

Definition at line 528 of file plotting.py.

529  def setXLabelSize(self, size):
530  self._frame.GetXaxis().SetLabelSize(size)
def setXLabelSize
Definition: plotting.py:528
def plotting.Frame.setXTitle (   self,
  title 
)

Definition at line 519 of file plotting.py.

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

Definition at line 525 of file plotting.py.

526  def setXTitleOffset(self, offset):
527  self._frame.GetXaxis().SetTitleOffset(offset)
def setXTitleOffset
Definition: plotting.py:525
def plotting.Frame.setXTitleSize (   self,
  size 
)

Definition at line 522 of file plotting.py.

523  def setXTitleSize(self, size):
524  self._frame.GetXaxis().SetTitleSize(size)
def setXTitleSize
Definition: plotting.py:522
def plotting.Frame.setYTitle (   self,
  title 
)

Definition at line 531 of file plotting.py.

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

Definition at line 537 of file plotting.py.

538  def setYTitleOffset(self, offset):
539  self._frame.GetYaxis().SetTitleOffset(offset)
def setYTitleOffset
Definition: plotting.py:537
def plotting.Frame.setYTitleSize (   self,
  size 
)

Definition at line 534 of file plotting.py.

535  def setYTitleSize(self, size):
536  self._frame.GetYaxis().SetTitleSize(size)
def setYTitleSize
Definition: plotting.py:534

Member Data Documentation

plotting.Frame._frame
private

Definition at line 477 of file plotting.py.

plotting.Frame._pad
private

Definition at line 476 of file plotting.py.