from java.awt import Color
from jhplot import *
# first function
f1 = F1D("2*exp(-x*x/50)+sin(pi*x)/x", 1.0, 10.0)
f1.setPenDash(4)
# second function
f2 = F1D("exp(-x*x/50)+pi*x", 1.0, 10.0)
f2.setColor(Color.green)
f2.setPenWidth(1)
# build a canvas with X and Y titles
c1 = HPlot("Canvas")
c1.setGTitle("2 functions", Color.red)
c1.setMarginLeft(90)
c1.setNameX("X")
c1.setNameY("Y")
c1.visible()
c1.setAutoRange()
c1.draw(f1)
c1.draw(f2)
Ads help maintain this website.