I have wrote a simple code to plot bar graph using matplotlib from a dataframe. Code is working properly but the xlabel
is not appering. Here is the code.
def dm2():
clear()
axis = [0,1,2,3,4]
top =df[df.Rating>=4]
top = top.head()
plt.bar(axis,top.Rating,width = 0.4)
plt.xticks(axis,top.Restaurant_Name, rotation = 45)
plt.xlabel("Restaurants")
plt.ylabel("Rating",fontsize = 12)
plt.title("Hotel Reviews")
plt.show()
and this is the result
question from:
https://stackoverflow.com/questions/65915327/xlabel-is-not-appearing 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…