# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt

import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'


#%% FONCTION

def f(x, K=5): #le "C=1", il fait que si tu précises rien, genre "f(3)", il prend par défaut C=1
    
    return (K*x)/(1+K*X)


#LISTE DES X
X = np.linspace(-1,1,1000) #début, fin, nombre de points

#LISTE DES Y
Y1 = f(X, K=1)
Y2 = f(X, K=5)
Y3 = f(X, K=100)

#%% GRAPHE

fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111)

ax.set_xlim(0,1) #Limites de l'axe X
ax.set_ylim(0,1) #Limites de l'axe Y

ax.set_xlabel(r'$P(SO2)$', fontsize = 20) #Titre axe X
ax.set_ylabel(r'$q/q_m$', fontsize = 20) #Titre axe Y


ax.plot(X,Y1, label=r'K = 1', lw=4) #label : nom dans la légende, lw : épaisseur du trait

ax.plot(X,Y2, label=r'K = 5', lw=4) #label : nom dans la légende, lw : épaisseur du trait

ax.plot(X,Y3, label=r'K = 100', lw=4) 

#%% OPTIONNEL

ax.grid(True) #Grille
ax.legend(loc=2 ,prop={'size':20}) #Legende


