I have a dataset having gdp of countries and their biofuel production named "Merging2". I am trying to plot a bar chart of top 5 countries in gdp and in the same plot have the bar chart of their biofuel_production.
I plotted the top gdp's using :
yr=Merging2.groupby(by='Years')
access1=yr.get_group(2019)
sorted=access1.sort_values(["rgdpe"], ascending=[False]) #sorting it
highest_gdp_2019=sorted.head(10) # taking the top 5 rgdpe
fig, ax=plt.subplots()
plt.bar(highest_gdp_2019.Countries,highest_gdp_2019.rgdpe, color ='black',width = 0.8,alpha=0.8)
ax.set_xlabel("Countries")
ax.set_ylabel("Real GDP")
plt.xticks(rotation = 90)
Is there a way to do that in Python ?