Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Add label to histogram

n, edges, patches = plt.hist(response_bachelor['Bachelor_GradYear'], bins = bins, 
                             color='#f0ae5d', edgecolor='w', label = 'No.of Responses') 

#add number of responses on top of each bin
for rect, label in zip(patches, n):
  height = rect.get_height()                   
  ax.text(rect.get_x() + rect.get_width()/2, height + 0.01, int(label), ha='center', va='bottom') 
Comment

PREVIOUS NEXT
Code Example
Python :: how to capture video in google colab with python 
Python :: how to kill somene 
Python :: plt python two axis 
Python :: matrix multiplication nupy 
Python :: pandas access multiindex column 
Python :: to_frame python 
Python :: django redirect 
Python :: python variable scope 
Python :: f readlines python not working 
Python :: how to find the longest string python 
Python :: is python a programming language 
Python :: python create random mac 
Python :: python string interpolation 
Python :: edit models in django admin 
Python :: pytube python 
Python :: Install discord.ui on windows 
Python :: identity matrix python 
Python :: sort 2 lists together python 
Python :: python for unity 
Python :: pandas dataframe from list how to make the date column an index 
Python :: get files in directory 
Python :: python oauthlib 
Python :: dictionary changed size during iteration 
Python :: python sort comparator 
Python :: python indentation 
Python :: Find the length of a nested list in python 
Python :: python list as queue 
Python :: data type array 
Python :: pandas make dataframe from few colums 
Python :: count elements in list python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =