Calculate derivative of X-Y data points and plot
Source code name: "data_p1d_dif.py"
Programming language: Python
Topic: Data arrays/P1D
DMelt Version 1. Last modified: 12/08/2015. License: Pro
https://datamelt.org/code/cache/data_p1d_dif_5132.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 jhplot  import  *
from java.awt import Color

p1=P1D("X-Y data points")

f=F1D("10*cos(0.1*x)",0,100)
for i in range(100):
         p1.add(i,f.eval(i))
        
c1 = HPlot("Canvas")
c1.visible()
c1.setAutoRange()
p2=p1.derivative()
p2.setColor(Color.red)
p2.setStyle("l")
c1.draw(p1)
c1.draw(p2)


You see the box below because you did not login.