Skip to content

Instantly share code, notes, and snippets.

@Klafyvel
Last active January 22, 2016 20:15
Show Gist options
  • Save Klafyvel/698759fa2773b5dec2eb to your computer and use it in GitHub Desktop.
Save Klafyvel/698759fa2773b5dec2eb to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as pl
import numpy as np
def uneFonction():
#Qui ne sert à rien, sinon
#Prouver à Charles et à Christophe la supériorité de python
#mouhahaha
pass
uneFonction()
pl.close('all')
x_min = -0.5
x_max = 0.98
X = np.linspace(x_min, x_max, 500)
f_p = lambda x,i: x**i + f_p(x,i-1) if i>0 else 1
Y_f = [(lambda x: 1 / (1-x))(i) for i in X]
pl.title("Petit gif du soir bonsoiiir")
p = int(input("Pmax="))
for i in range(p):
print("Image {}/{}".format(str(i+1), str(p)), end="\r")
pl.close('all')
pl.plot(X,[f_p(x,i) for x in X], label="$DL_{%d}$"%i)
pl.plot(X,Y_f,label="$x \\mapsto \\frac{1}{1-x}$")
#pl.ylim(-3, 3)
pl.legend(loc='best')
pl.savefig("{}.jpg".format('i'*(p-i)))
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment