Graficar sen(x)
#!/usr/bin/env python

from math import pi, sin
import Gnuplot

gp = Gnuplot.Gnuplot(persist = 1)
gp('set data style lines')

# A = amplitud
# dt = resolucion temporal
# omega = fase

A=2
dt=0.01
omega = 0
M = []

for i in range(0,101):
        M.append([i,A*sin(dt*i*2*pi + omega)])

plot1 = Gnuplot.PlotItems.Data(M, with="lines", title="x(t) = A*sin(2*pi*t + omega)")

gp.plot(plot1)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License