domingo, 20 de febrero de 2022

EJEMPLO 1 PYLAB, MATPLOTLIB PYTHON

 1. Librería gráfica: Pylab, Matplotlib

from pylab import*
x=arange(0,10,0.1) #Genera el vector x=[0, 0.1, 0.2, 0.3, . . . , 10]
plot(x,cos(x),'-b') #Grafica los puntos (x, cos(x)) con una linea azul
plot(x,log(x+1),'-r') #Grafica los puntos (x, log(x+1)) con una línea roja
title('Funciones')
xlabel('x')
ylabel('f(x)')
grid(True)
legend(('coseno','logaritmo'),loc='upper right')
show()
 
 

No hay comentarios: