plot 1/2
parent
8b1438145b
commit
df047379b6
@ -0,0 +1,64 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
fig = plt.figure(1)
|
||||
plt.subplot(421) # 設定子圖 421 表示4*2 位置1 不想塞子圖就註解
|
||||
duration_info_message = 8
|
||||
duration_info_message_bin = 4
|
||||
|
||||
width=0.3
|
||||
x = ['set1']
|
||||
x1=np.arange(len(x)) #X 軸 (第一組)
|
||||
y1=(8) #Y 軸1=duration_info_message
|
||||
x2=[p + width for p in x1] #X 軸 (第二組)
|
||||
y2=(4) #Y 軸2=duration_info_message_bin
|
||||
plt.bar(x1, y1, label='Json', width=0.1) #繪製長條圖
|
||||
plt.bar(x2, y2, label='protobuf', width=0.1) #繪製長條圖
|
||||
plt.xticks([p + width/2 for p in x1], x) #設定 X 軸刻度標籤
|
||||
plt.legend() #顯示圖例
|
||||
plt.title('duration_info') #設定圖形標題
|
||||
# plt.xlabel('x label') #設定 X 軸標籤
|
||||
plt.ylabel('MB') #設定 Y 軸標籤
|
||||
|
||||
|
||||
|
||||
plt.subplot(422)
|
||||
flight_info_message=85
|
||||
flight_info_message_bin=22
|
||||
width=0.3
|
||||
x = ['set2']
|
||||
x1=np.arange(len(x)) #X 軸 (第一組)
|
||||
y1=(85) #Y 軸1=duration_info_message
|
||||
x2=[p + width for p in x1] #X 軸 (第二組)
|
||||
y2=(22) #Y 軸2=duration_info_message_bin
|
||||
plt.bar(x1, y1, label='Json', width=0.1) #繪製長條圖
|
||||
plt.bar(x2, y2, label='protobuf', width=0.1) #繪製長條圖
|
||||
plt.xticks([p + width/2 for p in x1], x) #設定 X 軸刻度標籤
|
||||
plt.legend() #顯示圖例
|
||||
plt.title('flight_info') #設定圖形標題
|
||||
# plt.xlabel('x label') #設定 X 軸標籤
|
||||
plt.ylabel('MB') #設定 Y 軸標籤
|
||||
|
||||
|
||||
|
||||
fig = plt.figure(2)
|
||||
|
||||
json=404
|
||||
serial=97
|
||||
width=0.3
|
||||
x = ['set']
|
||||
x1=np.arange(len(x)) #X 軸 (第一組)
|
||||
y1=(404) #Y 軸1=duration_info_message
|
||||
x2=[p + width for p in x1] #X 軸 (第二組)
|
||||
y2=(97) #Y 軸2=duration_info_message_bin
|
||||
plt.bar(x1, y1, label='Json', width=0.1) #繪製長條圖
|
||||
plt.bar(x2, y2, label='protobuf', width=0.1) #繪製長條圖
|
||||
plt.xticks([p + width/2 for p in x1], x) #設定 X 軸刻度標籤
|
||||
plt.legend() #顯示圖例
|
||||
plt.title('flight_info') #設定圖形標題
|
||||
# plt.xlabel('x label') #設定 X 軸標籤
|
||||
plt.ylabel('MB') #設定 Y 軸標籤
|
||||
|
||||
|
||||
plt.show()
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
"2022-12-04T15:50:18.050641Z"
|
||||
"2022-12-08T07:22:43.602554Z"
|
||||
Loading…
Reference in New Issue