# Setting the positions and width for the barspos=list(range(len(df3['Air'])))width=0.25# Plotting the barsfig,ax=plt.subplots(figsize=(10,5))# Create a bar with pre_score data,# in position pos,plt.bar(pos,#using df['pre_score'] data,df3['Air'],# of widthwidth,# with alpha 0.5alpha=0.5,# with colorcolor='#EE3224',# with label the first value in first_namelabel=df3['Region'][0])# Create a bar with mid_score data,# in position pos + some width buffer,plt.bar([p+widthforpinpos],#using df['mid_score'] data,df3['Land'],# of widthwidth,# with alpha 0.5alpha=0.5,# with colorcolor='#F78F1E',# with label the second value in first_namelabel=df3['Region'][1])# Create a bar with post_score data,# in position pos + some width buffer,plt.bar([p+width*2forpinpos],#using df['post_score'] data,df3['Sea'],# of widthwidth,# with alpha 0.5alpha=0.5,# with colorcolor='#FFC222',# with label the third value in first_namelabel=df3['Region'][2])# Set the y axis labelax.set_ylabel('Arrival count')# Set the chart's titleax.set_title('Total arrival count by mode of transport by region in 2014')# Set the position of the x ticksax.set_xticks([p+1.5*widthforpinpos])# Set the labels for the x ticksax.set_xticklabels(df3['Region'])# Setting the x-axis and y-axis limitsplt.xlim(min(pos)-width,max(pos)+width*4)plt.ylim([0,max(df3['Air']+df3['Land']+df3['Sea'])])# Adding the legend and showing the plotplt.legend(['Air','Land','Sea'],loc='upper left')plt.grid()plt.show()