-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathstyles.py
More file actions
49 lines (45 loc) · 1.53 KB
/
styles.py
File metadata and controls
49 lines (45 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import ROOT
def errorStyle( color, markerStyle = 20, markerSize = 1, width = 1, drawOption='e1'):
def func( histo ):
histo.SetLineColor( color )
histo.SetMarkerSize( markerSize )
histo.SetMarkerStyle( markerStyle )
histo.SetMarkerColor( color )
# histo.SetFillColor( color )
histo.SetLineWidth( width )
histo.drawOption = drawOption
return
return func
def invisibleStyle ( ):
def func( histo ):
histo.SetMarkerSize(0)
histo.SetLineWidth(0)
return
return func
def lineStyle( color, width = None, dotted=False, dashed=False, errors = False):
def func( histo ):
histo.SetLineColor( color )
histo.SetMarkerSize( 0 )
histo.SetMarkerStyle( 0 )
histo.SetMarkerColor( color )
histo.SetFillColor( 0 )
if dotted: histo.SetLineStyle( 3 )
if dashed: histo.SetLineStyle( 7 )
if width: histo.SetLineWidth( width )
histo.drawOption = "hist"
if errors: histo.drawOption+='E'
return
return func
def fillStyle( color, lineColor = ROOT.kBlack, lineWidth = 1, errors = False):
def func( histo ):
lc = lineColor if lineColor is not None else color
histo.SetLineColor( lc )
histo.SetMarkerSize( 0 )
histo.SetMarkerStyle( 0 )
histo.SetMarkerColor( lc )
histo.SetFillColor( color )
histo.SetLineWidth( lineWidth )
histo.drawOption = "hist"
if errors: histo.drawOption+='E'
return
return func