ATLAS Offline Software
Loading...
Searching...
No Matches
ROOTUtils.StyleFactory Class Reference
Collaboration diagram for ROOTUtils.StyleFactory:

Public Member Functions

 __init__ (self, incMarker=True, incLine=True, incColor=True)
 nextStyle (self)
 nextMarkerStyle (self)
 nextLineStyle (self)
 nextColorStyle (self)

Public Attributes

int idMarker = -1
int idLine = -1
int idColor = -1
int incMarker = 1 if incMarker else 0
int incLine = 1 if incLine else 0
int incColor = 1 if incColor else 0

Static Public Attributes

list markerSequence = [ 8, 21, 22, 23, 29, 4, 25, 26, 27, 28, 30, 2, 3, 6]
list lineSequence = [ 1, 2, 3, 4]
list colorSequence = [ 1, 2, 4, 6, 8]

Detailed Description

StyleFactory is a helper class for assigning marker styles, line styles,
   and colors in ROOT plots.

Definition at line 171 of file roofit/ROOTUtils.py.

Constructor & Destructor Documentation

◆ __init__()

ROOTUtils.StyleFactory.__init__ ( self,
incMarker = True,
incLine = True,
incColor = True )

Definition at line 179 of file roofit/ROOTUtils.py.

179 def __init__(self,incMarker=True,incLine=True,incColor=True):
180 self.idMarker = -1
181 self.idLine = -1
182 self.idColor = -1
183 self.incMarker = 1 if incMarker else 0
184 self.incLine = 1 if incLine else 0
185 self.incColor = 1 if incColor else 0
186

Member Function Documentation

◆ nextColorStyle()

ROOTUtils.StyleFactory.nextColorStyle ( self)
Get next color.

Definition at line 207 of file roofit/ROOTUtils.py.

207 def nextColorStyle(self):
208 """Get next color."""
209 self.idColor +=1
210 return StyleFactory.colorSequence[self.idColor % len(StyleFactory.colorSequence)]
211
212

◆ nextLineStyle()

ROOTUtils.StyleFactory.nextLineStyle ( self)
Get next line style.

Definition at line 202 of file roofit/ROOTUtils.py.

202 def nextLineStyle(self):
203 """Get next line style."""
204 self.idLine +=1
205 return StyleFactory.lineSequence[self.idLine % len(StyleFactory.lineSequence)]
206

◆ nextMarkerStyle()

ROOTUtils.StyleFactory.nextMarkerStyle ( self)
Get next marker style.

Definition at line 197 of file roofit/ROOTUtils.py.

197 def nextMarkerStyle(self):
198 """Get next marker style."""
199 self.idMarker +=1
200 return StyleFactory.markerSequence[self.idMarker % len(StyleFactory.markerSequence)]
201

◆ nextStyle()

ROOTUtils.StyleFactory.nextStyle ( self)
Get next style cycling through markers, lines and colors as specified by
   the flags in the constructor. Returns a triplet of (marker,line,color) styles.

Definition at line 187 of file roofit/ROOTUtils.py.

187 def nextStyle(self):
188 """Get next style cycling through markers, lines and colors as specified by
189 the flags in the constructor. Returns a triplet of (marker,line,color) styles."""
190 self.idMarker += self.incMarker
191 self.idLine += self.incLine
192 self.idColor += self.incColor
193 return (StyleFactory.markerSequence[self.idMarker % len(StyleFactory.markerSequence)],
194 StyleFactory.lineSequence[self.idLine % len(StyleFactory.lineSequence)],
195 StyleFactory.colorSequence[self.idColor % len(StyleFactory.colorSequence)])
196

Member Data Documentation

◆ colorSequence

list ROOTUtils.StyleFactory.colorSequence = [ 1, 2, 4, 6, 8]
static

Definition at line 177 of file roofit/ROOTUtils.py.

◆ idColor

int ROOTUtils.StyleFactory.idColor = -1

Definition at line 182 of file roofit/ROOTUtils.py.

◆ idLine

int ROOTUtils.StyleFactory.idLine = -1

Definition at line 181 of file roofit/ROOTUtils.py.

◆ idMarker

int ROOTUtils.StyleFactory.idMarker = -1

Definition at line 180 of file roofit/ROOTUtils.py.

◆ incColor

int ROOTUtils.StyleFactory.incColor = 1 if incColor else 0

Definition at line 185 of file roofit/ROOTUtils.py.

◆ incLine

int ROOTUtils.StyleFactory.incLine = 1 if incLine else 0

Definition at line 184 of file roofit/ROOTUtils.py.

◆ incMarker

int ROOTUtils.StyleFactory.incMarker = 1 if incMarker else 0

Definition at line 183 of file roofit/ROOTUtils.py.

◆ lineSequence

list ROOTUtils.StyleFactory.lineSequence = [ 1, 2, 3, 4]
static

Definition at line 176 of file roofit/ROOTUtils.py.

◆ markerSequence

list ROOTUtils.StyleFactory.markerSequence = [ 8, 21, 22, 23, 29, 4, 25, 26, 27, 28, 30, 2, 3, 6]
static

Definition at line 175 of file roofit/ROOTUtils.py.


The documentation for this class was generated from the following file: