Created
October 15, 2022 19:20
-
-
Save ailtonbsj/05259c38eb9fee109e356378ed324171 to your computer and use it in GitHub Desktop.
Using Python Gnuplot like Matlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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