Skip to content

Instantly share code, notes, and snippets.

@ailtonbsj
Created October 15, 2022 19:20
Show Gist options
  • Save ailtonbsj/05259c38eb9fee109e356378ed324171 to your computer and use it in GitHub Desktop.
Save ailtonbsj/05259c38eb9fee109e356378ed324171 to your computer and use it in GitHub Desktop.
Using Python Gnuplot like Matlab
from numpy import *
from matplotlib.pyplot import *
import Gnuplot, Gnuplot.funcutils
import time
#Inicializa e usa linhas
g = Gnuplot.Gnuplot(debug=0)
g('set style data lines')
for i in arange(1,100,0.1):
x = arange(1,10,0.01)
y1 = sin(x+i)+0.12*cos(i*x)
y2 = cos(x-i*i)
#Relaciona dados a cor
d1 = Gnuplot.Data(y1,with_='lines 1')
d2 = Gnuplot.Data(y2,with_='lines 3')
#Plota dados
g.plot(d1,d2)
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment