import matplotlib.
pyplot as plt
import [Link] as patches
# Configurar la figura para alta resolución y aspecto profesional
fig, ax = [Link](figsize=(14, 10), dpi=300)
ax.set_xlim(0, 100)
ax.set_ylim(0, 100)
[Link]('off')
# Paleta de colores elegante (Aeronáutica/Institucional)
bg_color = '#F8FAFC' # Fondo gris muy claro
color_effects = '#BA1A1A' # Rojo desaturado para Efectos
(Gravedad)
color_problem = '#1E3A8A' # Azul marino para el Problema Central
color_causes = '#2E7D32' # Verde oscuro para las Causas (Raíces)
color_text_light = '#FFFFFF'
color_text_dark = '#1E293B'
# Cambiar el fondo de la figura
[Link].set_facecolor(bg_color)
def draw_box(ax, x, y, width, height, facecolor, edgecolor, title,
text_lines, title_color='#FFFFFF', text_color='#FFFFFF'):
# Dibujar caja con bordes redondeados
box = [Link]((x, y), width, height,
boxstyle="round,pad=1.5",
facecolor=facecolor, edgecolor=edgecolor,
linewidth=1.5)
ax.add_patch(box)
# Añadir título en negrita
[Link](x + width/2, y + height - 2, title, fontsize=10,
fontweight='bold',
color=title_color, ha='center', va='center', wrap=True)
# Añadir líneas de texto
y_offset = 3.5
for line in text_lines:
[Link](x + width/2, y + height - y_offset, line, fontsize=8.5,
color=text_color, ha='center', va='center', wrap=True)
y_offset += 2.2
# --- CONEXIONES (FLECHAS Y LÍNEAS) ---
# Líneas de Causas al Problema Central
[Link]('', xy=(50, 42), xytext=(20, 26),
arrowprops=dict(arrowstyle="->", color='#94A3B8', lw=2,
connectionstyle="bar,angle=180,fraction=-0.2"))
[Link]('', xy=(50, 42), xytext=(50, 26),
arrowprops=dict(arrowstyle="->", color='#94A3B8', lw=2))
[Link]('', xy=(50, 42), xytext=(80, 26),
arrowprops=dict(arrowstyle="->", color='#94A3B8', lw=2,
connectionstyle="bar,angle=180,fraction=0.2"))
# Líneas del Problema Central a los Efectos
[Link]('', xy=(20, 70), xytext=(50, 56),
arrowprops=dict(arrowstyle="<-", color='#94A3B8', lw=2,
connectionstyle="bar,angle=180,fraction=0.2"))
[Link]('', xy=(50, 70), xytext=(50, 56),
arrowprops=dict(arrowstyle="<-", color='#94A3B8', lw=2))
[Link]('', xy=(80, 70), xytext=(50, 56),
arrowprops=dict(arrowstyle="<-", color='#94A3B8', lw=2,
connectionstyle="bar,angle=180,fraction=-0.2"))
# --- NIVEL 1: EFECTOS (Ramas/Hojas) ---
draw_box(ax, 5, 72, 26, 15, color_effects, color_effects, "EFECTO
RELEVANTE 1",
["Limitación en el desarrollo", "de competencias prácticas", "y
análisis dinámico en", "los 48 estudiantes activos."], color_text_light,
color_text_light)
draw_box(ax, 37, 72, 26, 15, color_effects, color_effects, "EFECTO
CENTRAL",
["Proceso de enseñanza-", "aprendizaje predominantemente",
"teórico y memorístico,", "alejado de la cinemática real."],
color_text_light, color_text_light)
draw_box(ax, 69, 72, 26, 15, color_effects, color_effects, "EFECTO
RELEVANTE 2",
["Riesgo de egresar ingenieros", "con brechas técnicas en",
"diagnóstico de fallas", "(Troubleshooting) real."], color_text_light,
color_text_light)
# --- NIVEL 2: PROBLEMA CENTRAL (Tronco) ---
draw_box(ax, 23, 44, 54, 13, color_problem, color_problem,
"PROBLEMA CENTRAL",
["El Laboratorio de Ingeniería en Mantenimiento Aeronáutico del
IUAC carece de equipos,", "componentes didácticos dinámicos y
bancos de prueba interactivos para la simulación", "operacional de
sistemas críticos como el Tren de Aterrizaje."], color_text_light,
color_text_light)
# --- NIVEL 3: CAUSAS (Raíces) ---
draw_box(ax, 5, 12, 26, 15, color_causes, color_causes, "CAUSA
DIRECTA A",
["Infraestructura del nuevo", "laboratorio en etapa inicial", "de
transición,", "partiendo desde cero (0)."], color_text_light,
color_text_light)
draw_box(ax, 37, 12, 26, 15, color_causes, color_causes, "CAUSA
DIRECTA B",
["Altos costos de adquisición", "de módulos de fábrica y",
"sistemas comerciales", "de entrenamiento original."],
color_text_light, color_text_light)
draw_box(ax, 69, 12, 26, 15, color_causes, color_causes, "CAUSA
DIRECTA C",
["Inventario actual limitado", "a maquetas estáticas de",
"exposición que carecen de", "funcionalidad técnica."],
color_text_light, color_text_light)
# --- TÍTULO GENERAL DEL GRÁFICO ---
[Link](50, 96, "ÁRBOL DE PROBLEMAS: DIAGNÓSTICO DEL
LABORATORIO IUAC", fontsize=14, fontweight='bold',
color='#0F172A', ha='center')
[Link](50, 93, "Fase I: Exploración Inicial - Ingeniería en
Mantenimiento Aeronáutico", fontsize=10, style='italic',
color='#475569', ha='center')
# Guardar la imagen en alta calidad
output_path = "arbol_de_problemas_iuac.png"
[Link](output_path, bbox_inches='tight',
facecolor=fig.get_facecolor(), edgecolor='none')
[Link]()