Several 1D functions on 2 pads
Code: "func_1D.py". Programming language: Python DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/func_1D_7668.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



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("X")
c1.setNameY("Y")
c1.setName("Canvas title")
c1.visible(1)
c1.setAutoRange()


f1 = F1D("2*exp(-x*x/50)+sin(pi*x)/x")
f1.setPenDash(4)
c1.draw(f1,1.0,100)

f1 = F1D("exp(-x*x/50)+pi*x")
f1.setColor(Color.green)
f1.setPenWidth(1)
c1.draw(f1,-10,10)

c1.cd(2,1)
f1 = F1D("20*x*x")
f1.setColor(Color.red)
f1.setPenWidth(3)
c1.draw(f1,5,10)

f1 = F1D("sqrt(x*x)+20*x")
f1.setColor(Color.blue)
f1.setPenWidth(3)
c1.draw(f1)

f1 = F1D("15*sqrt(x*x)+20*x*x")
f1.setColor(Color.blue)
f1.setPenDash(3)
c1.draw(f1);

c1.visible(1)
"""

# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")

You see the box below because you did not login.