Feeds:
Posts
Comments

Archive for April 7th, 2020

In this tutorial, I will show you how to create Bar graph. Many people use Bar graph because it’s easy to presenting a comparison between 1,2 or 3 value. More than that it’s not recommended because it will be difficult to show the comparison.

Bar Chart can Vertical or Horizontal, depend on what you need.

Single Bar Vertical
Let’s try with Single bar vertical. Type the code below and run in your python text editor.

import matplotlib.pyplot as plt
month=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
revenue=[100,110,120,100,90,115,70,90,140,100,110,120]
plt.bar(month,revenue) 
plt.title('Simple Bar Graph') 
plt.xlabel('Month') 
plt.ylabel('Revenue (K)USD')
plt.grid(linestyle='dotted',axis='y')
plt.legend() 
plt.show()

bar01
bar02
(more…)

Read Full Post »