Created
June 1, 2020 03:09
-
-
Save iangelmx/7a677631a09a46bc570915f4097de2b2 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
#Obtenemos los datos de la pivot table y los graficamos | |
axes = table.plot(kind='bar', rot=15) | |
#Leyendas en los ejes | |
axes.set_ylabel('Millones de pruebas realizadas') | |
axes.set_xlabel('Países') | |
#Cambiamos escala en Y | |
axes.set_ylim(0,7000000) | |
fig = axes.get_figure() | |
#Cambiamos tamaño de gráfica | |
fig.set_size_inches(14, 7) | |
#Iteramos en cada barra para pintar sus valores en la gráfica | |
for bar in axes.patches: | |
axes.annotate( | |
"{:,}".format( bar.get_height() ), | |
(bar.get_x() * 1.005, bar.get_height() * 1.005) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment