import matplotlib.pyplot as plt import scipy.optimize as spo import numpy as np pKA = float(input("pKA = ")) def alpha(pH): return 100*(10**(-pH))/((10**(-pH))+10**(-pKA)) def beta(pH): return 100*(10**(-pKA))/((10**(-pH))+10**(-pKA)) pH=np.linspace(0,14,100) plt.plot(pH,alpha(pH),"r",label="% de AH") plt.plot(pH,beta(pH),"g",label="% de A-") plt.xlabel("pH") plt.ylabel("%") plt.show()