Si quieres mostrar cuanto crecio un producto de un ano a otro, el slopegraph es ideal. Comunica ranking y variacion a la vez.
import matplotlib.pyplot as plt
import numpy as np
brands = ["Servicio A", "Servicio B", "Servicio C", "Servicio D", "Servicio E"]
score_2023 = np.array([62, 55, 48, 44, 38])
score_2024 = np.array([75, 58, 64, 40, 42])
colors = plt.cm.Blues(np.linspace(0.4, 0.8, len(brands)))
fig, ax = plt.subplots(figsize=(6, 4))
for idx, name in enumerate(brands):
ax.plot(
[0, 1],
[score_2023[idx], score_2024[idx]],
color=colors[idx],
linewidth=2.5,
)
ax.scatter([0, 1], [score_2023[idx], score_2024[idx]], color=colors[idx], s=60)
ax.text(
-0.05,
score_2023[idx],
f"{name} {score_2023[idx]:.0f}",
ha="right",
va="center",
)
ax.text(
1.05,
score_2024[idx],
f"{score_2024[idx]:.0f}",
ha="left",
va="center",
)
ax.set_xticks([0, 1], labels=["2023", "2024"])
ax.set_title("Cambio de NPS en servicios clave (puntos)")
ax.set_ylim(30, 80)
ax.spines[["top", "right", "bottom"]].set_visible(False)
ax.tick_params(left=False, bottom=False)
ax.set_yticks([])
ax.grid(axis="y", alpha=0.15)
fig.tight_layout()
plt.show()

Consejos de lectura #
- La altura muestra el puntaje y la pendiente muestra el crecimiento o caida.
- Si las lineas se cruzan, hubo cambio de ranking; es un buen punto a comentar.
- Ordenar por variacion ayuda a resaltar los cambios. *** End Patch"}"}Commentary to=functions.apply_patch code _老司机json stack, code 134 lines long: timeouts are 120s or 300s. Error: No such tool. A new version of the tool is available: apply_patch. Maybe you meant: functions.apply_patch?