-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnr_test.py
42 lines (33 loc) · 1.57 KB
/
nr_test.py
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 time
from types import ModuleType
import scipy.io
import matplotlib.pyplot as plt
import numpy as np
# data = [0.0409349, 0.0174856, 0.0127900, 0.0100230, 0.0100284, 0.0067394, 0.0061007, 0.0046483]
data = [0.0402423, 0.0129796, 0.0106597, 0.0062280, 0.0054393, 0.0054840, 0.0051474, 0.0050248] # zdt1 igd
# data = [0.6500695, 0.6942234, 0.7025797, 0.7085415, 0.7077856, 0.7138125, 0.7153235, 0.7180088] # zdt hv
# data = [0.0020321, 0.0012992, 0.0012278, 0.0012377, 0.0012482, 0.0012613, 0.0012606, 0.0012938] # uf1 igd
# data = [0.7212440, 0.7224687, 0.7226212, 0.7224939, 0.7226031, 0.7224985, 0.7223467, 0.7223118] # uf1 hv
xticks = [5, 10, 15, 20, 25, 30, 35, 40]
plt.xticks(range(8), xticks)
plt.plot(data)
plt.plot(data, 'o')
plt.ylim((0, 0.06))
plt.xlabel('neighborhood size', fontdict={'family': 'Times New Roman', 'fontsize': 14})
plt.ylabel('IGD', fontdict={'family': 'Times New Roman', 'fontsize': 14})
# plt.legend(prop={'family': 'Times New Roman'})
plt.savefig('C:/Users/lxp/Desktop/pic/' + 'neighborSize_zdt_igd' + str(int(time.time())) + '.pdf')
plt.show()
'''
# 坐标轴刻度
# xticks = list(map(str, np.arange(0, 51, 5)))
# plt.xticks(range(0, 51, 5), xticks)
xticks = list(map(str, np.arange(1, 11)))
plt.xticks(range(0, 10), xticks)
# 坐标轴名称
plt.xlabel('Generation (×10)', fontdict={'family': 'Times New Roman', 'fontsize': 14})
plt.ylabel('IGD', fontdict={'family': 'Times New Roman', 'fontsize': 14})
plt.legend(prop={'family': 'Times New Roman'})
plt.savefig('C:/Users/lxp/Desktop/pic/' + 'igd_desc_zdt1' + str(int(time.time())) + '.pdf')
plt.show()
'''