-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_
More file actions
46 lines (40 loc) · 1.15 KB
/
Copy path_
File metadata and controls
46 lines (40 loc) · 1.15 KB
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
43
44
45
import pandas as p
import matplotlib.pyplot as pt
import math
def pbar(c,picturename):
df = c
col = list(df.columns)
ymin = min(df[col[0]])
ymax = max(df[col[0]])
ylist = range(math.floor(min(df[col[1]])), max(df[col[1]]) + 1)
pt.bar(df[col[0]], df[col[1]])
pt.xlabel(col[0])
pt.ylabel(col[1])
pt.xticks(rotation = 'vertical')
pt.yticks(ylist)
pt.savefig(f'{picturename}.png', bbox_inches = 'tight')
pt.close()
def pbarh(c,picturename):
df = c
col = list(df.columns)
pt.bar(df[col[0]], df[col[1]])
pt.xlabel(col[0])
pt.ylabel(col[1])
pt.xticks(rotation = 'vertical')
pt.savefig(f'{picturename}.png', bbox_inches = 'tight')
pt.close()
def pplolt(c, picturename):
df = c
col = list(df.columns)
pt.plot(df[col[0]], df[col[1]], marker = 'o')
pt.xlabel(col[0])
pt.ylabel(col[1])
pt.xticks(rotation = 'vertical')
pt.savefig(f'{picturename}.png', bbox_inches = 'tight')
pt.close()
def ppie(c,picturename):
df = c
col = list(df.columns)
pt.pie(df[col[1]], labels = df[col[0]])
pt.savefig(f'{picturename}.png', bbox_inches = 'tight')
pt.close()