-
-
Save HectorTorres/3db77275792202b66760672a094c18cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
import math | |
x = np.linspace(0, 10, 5000) | |
fig, ax = plt.subplots() # Crea la figura y los ejes. | |
ax.plot(x, x*0.1, label='Lineal') # Calcula y grafica, el parametro label es para escribir una etiqueta relacionada a esa grafica. | |
ax.plot(x, np.exp(x)*0.0002, label='Exponencial') | |
ax.plot(x, np.sin(x), label='Senoidal') | |
ax.set_xlabel('Tiempo') # Add an x-label to the axes. | |
ax.set_ylabel('Amplitud') # Add a y-label to the axes. | |
ax.set_title("Ejemplo Python") # Add a title to the axes. | |
ax.legend() # Imprime la leyenda. | |
plt.grid(True) | |
plt.show() # Llama a la grafica para que se muestre. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment