<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># importar todas las funciones de pylab
from pylab import *

# importar el mÃ³dulo pyplot
import matplotlib.pyplot as plt


def f1(x):
    return sin(x)


def f2(x):
    return sin(x) + sin(5.0 * x)


def f3(x):
    return sin(x) * exp(-x / 10.0)


# array de valores a representar
x = linspace(0, 10 * pi, 800)

p1, p2, p3 = plot(x, f1(x), x, f2(x), x, f3(x))

# AÃ±ado leyenda, tamaÃ±o de letra 10, en esquina superior derecha
legend(("Funcion 1", "Funcion 2", "Funcion 3"), prop={"size": 10}, loc="upper right")

xlabel("Tiempo / s")
ylabel("Amplitud / cm")
title("Representacion de tres funciones")

# Creo una figura (ventana), pero indico el tamaÃ±o (x,y) en pulgadas
figure(figsize=(12, 5))

show()
</pre></body></html>