from java.awt import Color
from jhplot import *
from jdistlib import *
def func(min,max): # evaluate Cauchy function
logz=Cauchy(1, 2) # initialaze function
f=P1D("Cauchy") # container to fill
step=(max-min)/100.0
for i in range(100):
x=min+step*i
f.add(x,logz.density(x, True) )
return f
c1 = HPlot('Beta') # plot
c1.visible(); c1.setAutoRange()
c1.setMarginLeft(80)
c1.setNameX("X")
c1.setNameY("Values")
p=func(-10,10) # plot between 1 and 100
p.setStyle('l')
p.setPenWidth(4)
p.setColor(Color.blue)
c1.draw(p)
Ads help maintain this website.