import matplotlib.pyplot as plt
lojas = ['A', 'B', 'C', 'D']
cores = ['b', 'g', 'y', 'r']
vendas_2022 = {
'Jan': [100, 80, 150, 50],
'Fev': [120, 90, 170, 60],
'Mar': [150, 100, 200, 80],
'Abr': [180, 110, 230, 90],
'Mai': [220, 190, 350, 200],
'Jun': [230, 150, 280, 120],
'Jul': [250, 170, 300, 140],
'Ago': [260, 180, 310, 150],
'Set': [240, 160, 290, 130],
'Out': [220, 140, 270, 110],
'Nov': [400, 220, 350, 190],
'Dez': [300, 350, 400, 250]
}
# Criando DataFrame
df = pd.DataFrame(vendas_2022, index=lojas)
df
fig, axs = plt.subplots(2, 2, figsize=(15, 7))
plt.subplots_adjust (wspace=0.2, hspace=0.3)
fig.suptitle('Vendas no ano de 2022 nas lojas A,B,C e D', fontsize=18)
for p, ax in enumerate(axs.flat):
ax.bar(df.columns.to_list(), df.loc[lojas[p]], color=cores[p])
ax.set_title(f'Vendas na loja {lojas[p]}', fontsize=14, loc = 'left')
ax.set_xlabel('')
ax.set_ylabel('Vendas')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.set_ylim(0,410)
ax.grid(True, linestyle='--',axis = 'y')
plt.show()