File size: 751 Bytes
efb524b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt1
import sys
import sqlite3

def viewg(g1):
    

    for row in g1.values():
        pass

    height=[]
    bars = ()
    bars= tuple(g1.keys())

    plt.clf()



    print(type(g1.values()))
    height= list(g1.values())
    print(bars, height)
    
    y_pos = np.arange(len(bars))
    plt.bar(bars,height, color=['blue', 'cyan', 'orange'])
    plt.xlabel('Sentiment Analysis')
    plt.ylabel('No.of Tweets')
    plt.title('Features')
    from PIL import Image 
    plt.savefig('g1.jpg')
    #im = Image.open(r"g1.jpg") 
          
    #im.show()
        
if __name__ == "__main__":
    d={'jan':2,'feb':23}
    viewg(d)