comparison paper/file/benchmark/bar.py @ 49:71e1425687f3

update tex
author Ken Miyahira <e175733@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2021 23:49:40 +0900
parents 47a9b8bf069b
children c72f0d0eb28a
comparison
equal deleted inserted replaced
48:47a9b8bf069b 49:71e1425687f3
4 def getData(): 4 def getData():
5 x, y = [], [] 5 x, y = [], []
6 print("データ読み込み") 6 print("データ読み込み")
7 x = [1, 2, 3] 7 x = [1, 2, 3]
8 label = ["Docker", "ie-podman", "Podman"] 8 label = ["Docker", "ie-podman", "Podman"]
9 y = [758.16, 809.34, 4999.47] 9 realtime = [59.52, 54.24, 199.40]
10 usertime = [7.52, 13.22, 23.18]
11 systime = [7.89, 8.69, 23.78]
10 12
11 name = input("GraphName: ") 13 name = input("GraphName: ")
12 xlabel = input("xlabel: ") 14 xlabel = input("xlabel: ")
13 ylabel = input("ylabel: ") 15 ylabel = input("ylabel: ")
14 xr = input("Xrange: ") 16 xr = input("Xrange: ")
15 xr = xr.split(" ") 17 xr = xr.split(" ")
16 yr = input("Yrange: ") 18 yr = input("Yrange: ")
17 yr = yr.split(" ") 19 yr = yr.split(" ")
18 # 画像出力 20 # 画像出力
19 print("画像出力") 21 print("画像出力")
20 plot_graph(name,x,y,float(xr[0]),float(xr[1]),float(yr[0]),float(yr[1]),xlabel,ylabel,label) 22 plot_graph(name,x,realtime,usertime,systime,float(xr[0]),float(xr[1]),float(yr[0]),float(yr[1]),xlabel,ylabel,label)
21 return name 23 return name
22 24
23 def plot_graph(name,x,y,sx,ex,sy,ey,xlabel,ylabel,label): 25 def plot_graph(name,x,realtime,usertime,systime,sx,ex,sy,ey,xlabel,ylabel,label):
24 plt.xlim(sx,ex) 26 plt.xlim(sx,ex)
25 plt.xlabel(str(xlabel)) 27 plt.xlabel(str(xlabel))
26 plt.ylim(sy,ey) 28 plt.ylim(sy,ey)
27 plt.ylabel(str(ylabel)) 29 plt.ylabel(str(ylabel))
28 plt.bar(x, y, tick_label=label, align="center") 30 realx = [1, 2, 3]
29 #for i in range(len(x)): 31 userx = [1.3,2.3,3.3]
30 # plt.plot(x[i],y[i], label=FILES[i].split("/")[-1])#markersize=0.5) 32 sysx = [1.6,2.6,3.6]
31 #plt.legend() 33 plt.bar(realx, realtime, label="real", width=0.3, align="center")
34 plt.bar(userx, usertime, label="user", width=0.3, align="center")
35 plt.bar(sysx, systime, label="sys", width=0.3, align="center")
36 plt.legend()
37 plt.xticks([1.25, 2.25, 3.25], label)
32 plt.savefig("./pdf/"+str(name)+".pdf") 38 plt.savefig("./pdf/"+str(name)+".pdf")
33 plt.delaxes() 39 plt.delaxes()
34 40
35 def openGraph(name): 41 def openGraph(name):
36 cmd = ["open", "./pdf/"+str(name)+".pdf"] 42 cmd = ["open", "./pdf/"+str(name)+".pdf"]