
from java.awt import Color
from java.util import Random
from jhplot  import *


c1 = HPlot("Canvas",600,400,1, 1)
c1.setGTitle("Global labels: F_{2} ,  x_{&gamma;}  #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)

# fit interactively this histogram
# pass objects and names (for code generation) 
a=HFit(c1,"c1",h1,"h1")

# add a user function if you want to
a.addFunc("User1", "Tooltip", "a*x[0]+b","a,b")

#
# after you did the fit, press "generate source".
# JAIDA source code will be appended in this file
