# Show how to visualise a 2D function using Python code
# @author Sergei Chekanov
from jhplot import F2D,HJavaView
from java.awt import Color
f1 = F2D("3*(x*x+y*y)", -1.0, 1.0, -1.0, 1.0)
c1= HJavaView()
obj1=c1.add(f1)
obj1.setTransparency(0.2);
obj1.showTransparency(True);
f2 = F2D("(x+y)", -1.0, 1.0, -1.0, 1.0)
obj2=c1.add(f2)
# draw 2 functions
c1.draw([obj1,obj2])
view=c1.getView()
disp=view.getDisplay()
disp.showAxes(True)
c1.visible()
Ads help maintain this website.