<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># http://pendientedemigracion.ucm.es/info/aocg/python/modulos_cientificos/matplotlib/index.html

import numpy as np
import matplotlib.pyplot as plt

# Creamos el array x de cero a cien con cien mil puntos
x = np.linspace(-10, 10, 100000)
# Creamos el array y conde cada punto es el seno de cada elemento de x
y = np.sin(1 / x)
# Grabamos los datos x e y
np.savetxt("valores.txt", (x, y))

# Creamos una figura
plt.figure()

# Representamos
plt.plot(x, y)
plt.xlabel("Angle [rad]")
plt.ylabel("sin(x)")
plt.axis("tight")

# Mostramos en pantalla
plt.show()
</pre></body></html>