绘制分形曲线图

import numpy as np
import matplotlib.pyplot as plt
net = 913
num = [1,2,3,4,5,6,7,8,9,10]
# net_913动脉树
net_913_ArtNorm = [1.3501,1.3311,1.3186,1.3331,1.3387,1.3273,1.3271,1.3421,1.3299,1.2932]
net_913_ArtSkel = [1.1102,1.0843,1.0902,1.1146,1.1201,1.1067,1.0967,1.1186,1.1201,1.0962]
# net_913静脉树
net_913_VenNorm = [1.3650,1.3769,1.3607,1.3782,1.3608,1.3788,1.3772,1.3742,1.3835,1.4193]
net_913_VenSkel = [1.0845,1.1095,1.0921,1.1046,1.0939,1.0983,1.1125,1.0971,1.0815,1.1364]
plt.title("Net_913 fractal dimension graph")
plt.xlabel('Serial number',size=14)
plt.ylabel('Fractal dimension',size=14)
plt.ylim(1,2)
plt.xticks(np.arange(0,10,1))
plt.yticks(np.arange(1,2,0.1))
plt.plot(num,net_913_ArtNorm,marker="d",linewidth=2,linestyle="-",color="orange")
plt.plot(num,net_913_ArtSkel,marker="s",linewidth=2,linestyle="--",color="orange")
plt.plot(num,net_913_VenNorm,marker="d",linewidth=2,linestyle="-",color="g")
plt.plot(num,net_913_VenSkel,marker="s",linewidth=2,linestyle="--",color="g")
plt.legend(["ArtNorm","ArtSkel","VenNorm","VenSkel"],loc="upper right ")
# 添加文字
t1 = "ArtNormMean=%f" % np.mean(net_913_ArtNorm)
t2 = "ArtSkelMean=%f" % np.mean(net_913_ArtSkel)
t3 = "VenNormMean=%f" % np.mean(net_913_VenNorm)
t4 = "VenSkelMean=%f" % np.mean(net_913_VenSkel)
plt.text(3, 1.9, t1, ha='left', rotation=0, wrap=True)
plt.text(3, 1.85, t2, ha='left', rotation=0, wrap=True)
plt.text(3, 1.8, t3, ha='left', rotation=0, wrap=True)
plt.text(3, 1.75, t4, ha='left', rotation=0, wrap=True)
plt.savefig('net_%d.png' % net )
plt.show()

猜你喜欢

转载自blog.csdn.net/qq_38826019/article/details/88108541
今日推荐