代码拉取完成,页面将自动刷新
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()
'''
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。