Skip to content

Basic Barplot with Matplotlib . A barplot shows the relationship between a numeric and a categoric variable.

Notifications You must be signed in to change notification settings

pritomsh/barplot-with-matplotlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Barplot ?

A barplot shows the relationship between a numeric and a categoric variable. Each entity of the categoric variable is represented as a bar. The size of the bar represents its numeric value.

plt.bar(data.Area.unique(), data.Area.value_counts(), width=.3, color=['black', 'red', 'green', 'blue', 'cyan'])

plt.barh(data.Area.unique(), data.Area.value_counts(), color=(0.2, 0.6, 0.6, 0.6))

  • plt.xlabel('category', fontweight='bold', color = 'green', fontsize='18')
  • plt.ylabel('values', color = 'red', fontsize='18')
  • plt.xticks(color='orange')
  • plt.yticks(color='orange')

Label socre

plt.bar(data.Area.unique(), data.Area.value_counts(), color=['green'], edgecolor='red')

fig.text(.6, -0.15, '© Pritom Saha', fontsize = 12,color ='red', ha ='right', va ='bottom',alpha = 0.7)

Ref : The Python Graph Gallery Barplot

About

Basic Barplot with Matplotlib . A barplot shows the relationship between a numeric and a categoric variable.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published