import matplotlib.pyplot as plt
import numpy as np

# Datos
eficiencia_optica = [0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6]
eficiencia_electrica = [0.2916, 0.2754, 0.2592, 0.243, 0.2268, 0.2106, 0.1944]
eficiencia_termica = [0.4881, 0.4627, 0.4372, 0.4118, 0.3863, 0.3608, 0.3354]

# Crear figura y ejes
fig, ax = plt.subplots()

# Graficar eficiencia eléctrica en azul con círculos
ax.plot(eficiencia_optica, eficiencia_electrica, marker='o', linestyle='-', color='blue', label='Eficiencia Eléctrica')

# Graficar eficiencia térmica en rojo con triángulos
ax.plot(eficiencia_optica, eficiencia_termica, marker='^', linestyle='-', color='red', label='Eficiencia Térmica')

# Leyendas en la esquina superior izquierda dentro del gráfico
ax.legend(loc='upper left')

# Ajustes de estilo
plt.grid(False)
plt.rcParams.update({'font.family': 'Times New Roman'})
plt.title('Eficiencia Eléctrica y Térmica en Función de la Eficiencia Óptica', fontsize=14)

# Etiquetas de los ejes
plt.xlabel('Eficiencia Óptica')
plt.ylabel('Eficiencias')

# Mostrar el gráfico
plt.show()

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: