Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

python 3.x - Xlabel is not appearing

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

1

question from:https://stackoverflow.com/questions/65915327/xlabel-is-not-appearing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...