ATLAS Offline Software
Loading...
Searching...
No Matches
python.ROOTUtils.StyleFactory Class Reference
Collaboration diagram for python.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 168 of file python/ROOTUtils.py.

Constructor & Destructor Documentation

◆ __init__()

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

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

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

Member Function Documentation

◆ nextColorStyle()

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

Definition at line 204 of file python/ROOTUtils.py.

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

◆ nextLineStyle()

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

Definition at line 199 of file python/ROOTUtils.py.

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

◆ nextMarkerStyle()

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

Definition at line 194 of file python/ROOTUtils.py.

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

◆ nextStyle()

python.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 184 of file python/ROOTUtils.py.

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

Member Data Documentation

◆ colorSequence

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

Definition at line 174 of file python/ROOTUtils.py.

◆ idColor

int python.ROOTUtils.StyleFactory.idColor = -1

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

◆ idLine

int python.ROOTUtils.StyleFactory.idLine = -1

Definition at line 178 of file python/ROOTUtils.py.

◆ idMarker

int python.ROOTUtils.StyleFactory.idMarker = -1

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

◆ incColor

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

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

◆ incLine

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

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

◆ incMarker

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

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

◆ lineSequence

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

Definition at line 173 of file python/ROOTUtils.py.

◆ markerSequence

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

Definition at line 172 of file python/ROOTUtils.py.


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