예제 #1
0
n1.binSize = 1
n1.histo(verbose=False, padMin=-3, padMax=15.)

n2 = Numbers(nv2)
n2.binSize = 1
n2.histo(verbose=False, padMin=-3, padMax=15.)

# prepare the binNames, and extract the histo values into separate
# lists.
binNames = []
vals1 = []
vals2 = []
for bNum in range(n1.nBins - 1):
    binNames.append('%i' % int(n1.bins[bNum][0]))
    vals1.append(float(n1.bins[bNum][1]))
    vals2.append(float(n2.bins[bNum][1]))
assert len(binNames) == len(vals1)
assert len(vals1) == len(vals2)

gp = Plot()
gp.baseName = 'twoBarsB'
gp.bars(binNames, [vals1, vals2])
gp.barValAxis.title = None
gp.barNameAxis.title = None
gp.maxBarValToShow = 800.
gp.barNameAxis.barLabelsEvery = 2
gp.barNameAxis.barLabelsSkipFirst = 1
gp.barNameAxis.textRotate = 90
gp.png()
gp.svg()
예제 #2
0
from gram import Plot
from data5 import xx1, yy1, binNames, binVals
gp = Plot()
gp.baseName = 'lineAndBar_good'
c = gp.bars(binNames,binVals)
gp.minBarValToShow = 0.0
gp.barNameAxis.title = None
gp.barValAxis.title = 'frequency'
c.barSets[0].fillColor = 'black!10'
gp.barNameAxis.barLabelsEvery = 2
#gp.barNameAxis.textRotate = 90
gp.line(xx1, yy1, smooth=True)
gp.xAxis.position = 't'
gp.yAxis.position = 'r'
gp.xAxis.title = None
gp.yAxis.title = 'density'
gp.maxXToShow = 4.0
gp.xAxis.tickLabelsEvery = 1
gp.maxBarValToShow = 5000
gp.maxYToShow = 1.0
gp.font = 'helvetica'
gp.png()
gp.svg()
예제 #3
0
파일: barB.py 프로젝트: pgfoster/gram
from gram import Plot
read("data2.py")
gp = Plot()
gp.baseName = 'barB'
gp.font = 'helvetica'
c = gp.bars(xx1, yy1)
# c.barSets[0].fillColor = 'violet!20'
gp.barValAxis.title = 'gnat infestations'
gp.barNameAxis.title = None
#gp.barValAxis.position = 'r'
#gp.barNameAxis.position = 't'
gp.minBarValToShow = 0.
gp.maxBarValToShow = 80.
gp.barNameAxis.textRotate = 44
# gp.png()
gp.png()
gp.svg()
예제 #4
0
from gram import Plot
read('data5.py')
gp = Plot()
gp.baseName = 'lineAndBar_good'
c = gp.bars(binNames, binVals)
gp.minBarValToShow = 0.0
gp.barNameAxis.title = None
gp.barValAxis.title = 'frequency'
c.barSets[0].fillColor = 'black!10'
gp.barNameAxis.barLabelsEvery = 2
#gp.barNameAxis.textRotate = 90
gp.line(xx1, yy1, smooth=True)
gp.xAxis.position = 't'
gp.yAxis.position = 'r'
gp.xAxis.title = None
gp.yAxis.title = 'density'
gp.maxXToShow = 4.0
gp.xAxis.tickLabelsEvery = 1
gp.maxBarValToShow = 5000
gp.maxYToShow = 1.0
gp.png()
gp.svg()