c1 = HPlot("Canvas",600,400) c1.setGTitle("Global labels: F_{2} , x_{γ} #bar{p}p F_{2}^{c#bar{c}}"); #put title c1.visible(1) c1.setAutoRange() h1 = H1D("Simple1",20, -2.0, 2.0) rand = Random() # fill histogram for i in range(100): h1.fill(rand.nextGaussian()) c1.draw(h1) h1.setPenWidthErr(2) c1.setNameX("Xaxis") c1.setNameY("Yaxis") c1.setName("Canvas title") c1.drawStatBox(h1) # set HLabel in the normilised coordinate system lab=HLabel("HLabel in NDC", 0.15, 0.7, "NDC") lab.setColor(Color.blue) c1.add(lab)
# Function | C | 1.7 | S.Chekanov | A function in 1D (F1D). from java.awt import Font,Color from jhplot import HPlot,F1D c1 = HPlot("Canvas",800,400,2, 1) c1.setGTitle("Example of functions", Color.red) #put title c1.setNameX("Xaxis") c1.setNameY("Yaxis") c1.setName("Canvas title") c1.visible(1) c1.setAutoRange() f1 = F1D("2*exp(-x*x/50)+sin(pi*x)/x", -2.0, 5.0) f1.setPenDash(4) c1.draw(f1) f1 = F1D("exp(-x*x/50)+pi*x", -2.0, 5.0) f1.setColor(Color.green) f1.setPenWidth(1) c1.draw(f1) c1.cd(2,1) c1.setAutoRange() f1 = F1D("20*x*x", -2.0, 5.0) f1.setColor(Color.red) f1.setPenWidth(3) c1.draw(f1) f1 = F1D("10*sqrt(x)+20*x", 0.1, 10.0)
p6.setSymbolSize(7) p6.setPenWidthErr(2) p6.setColor(c) p6.add(2.04, 0.02, 0.002, 0.002) p6.add(5.01, 0.019, 0.002, 0.002) p6.add(16, 0.020, 0.002, 0.002) p6.add(53, 0.017, 0.002, 0.003) p6.add(61.6, 0.013, 0.002, 0.003) p7 = P1D("pp,pA d, #bar{d}") c = Color.blue p7.setLegend(0) lab2 = HLabel(" #bar{d}(Υ(1,2S))", 0.6, 0.007) lab2.setColor(c) c1.add(lab2) p7.setErrColor(c) p7.setSymbolSize(7) p7.setPenWidthErr(2) p7.setColor(c) p7.add(10.0, 0.0063, 0.002, 0.002) c1.draw(p2) c1.draw(p3) c1.draw(p1) c1.draw(p4) c1.draw(p5) c1.draw(p6) c1.draw(p7)