File size: 26,615 Bytes
4960377 | 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | # import numpy as np
# import math
# import matplotlib.pyplot as plt
# from matplotlib import font_manager
#
# plt.rcParams['font.family'] = 'Times New Roman'
# from mpl_toolkits.axes_grid1 import make_axes_locatable
# import matplotlib.gridspec as gridspec
# # 数据准备
# # x1 = np.arange(1, 6) # 创建从 1 到 5 的数组 CC:contrast VC:video compression GN:gaussian noise GB:gaussian blur CS:saturation BW:block-wise GNC: pixelation
# # y11 = np.arange(50, 101, 10) # 创建从 50 到 100,间隔为 10 的数组 saturation里面的数据
# x = [0,1, 2, 3, 4, 5]
# #y1 = [54, 44.66, 44.72, 38.08, 40.13,37.45] #xception
# y2 = [45, 31.20, 35.63, 25.20, 22.24,28.3] # CViT
# y3 = [43, 37.93, 38.64, 31.55, 29.81,20.63] # crossvit
# y4 = [43, 33.34,45.64, 34.41, 40.04,38.58] # evit 43,33.34,45.64, 34.41, 40.04,38.58
# y5 = [46, 36.96, 44.13, 38.65, 41.91,39.13] #ours
# #第二组 contrast里数据
# #y1_2 = [61, 53.82, 50.95, 47.47, 38.93,31.14] #
# y2_2 = [55, 45.41, 48.06, 39.53, 30.18,17.11]
# y3_2 = [56, 46.82, 38.47,25.68, 24.47,13.72]
# y4_2 = [58,44.57,49.03, 33.22, 34.30,26.09]#60, 50.91, 48.28, 30.86, 28.01,24.24
# y5_2 = [60, 50.91, 48.28, 33.86, 32.01,28.24]
#
# #y1_3 = [63, 57.21, 58.87, 59.83, 55.44,55.20]
# y2_3 = [53, 43.98, 44.05, 47.05, 49.11,39.17]
# y3_3 = [55, 45.54, 50.04, 47.71, 46.21,36.16]
# y4_3 = [55,45.07,43.64, 49.42, 50.11,36.72] #
# y5_3 = [55, 45.69, 56.25, 54.30, 51.26,41.61]
#
# #y1_4 = [20, 9.81, 1.7, 0.7, 0.11,0.02]
# y2_4 = [26, 18.52, 4.0, 3.9, 3.7,2.5]
# y3_4 = [34, 24.23, 4.02, 3.5, 3.07,2.01]
# y4_4 = [28,18.56,15.07, 7.3, 2.7,2.0]#31, 21.52, 6.1, 0.9, 0.3,0.2
# y5_4 = [31, 21.52, 16.1, 7.9, 3.3,2.2]
#
# #y1_5 = [67, 61.28, 57.58, 55.90, 56.72,50.58]
# y2_5 = [47, 37.29, 31.62, 25.26, 27.64,21.16]
# y3_5 = [57, 47.87, 48.63, 45.29, 45.96,40.68]
# y4_5 = [57,47.11,42.52, 46.48, 47.78,46.78]#
# y5_5 = [53, 43.30, 42.53, 46.07, 47.64,45.43]
#
# #y1_6 = [56.3, 46.2, 45.3, 43.2, 35.1,25.3]
# y2_6 = [50.85, 38.83, 37.52, 36.31, 29.10,25.20]
# y3_6 = [55.2, 45.2, 44.2, 43.5, 35,26.3]
# y4_6 = [59,39.43,38.53, 37.67, 30.04,20.01]#
# y5_6 = [60, 45.73, 45.56, 43.54, 36.21,26.45]
#
# #y1_7 = [64, 54.65, 56.97, 55.93, 58.59,59.89]
# y2_7 = [51, 45, 45.30, 42.05, 38.75,31.10]
# y3_7 = [61, 51.78, 48.76, 45.82, 41.44,41.10]
# y4_7 = [60, 50.15, 52.05, 50.02, 48.49,42.15] #
# y5_7 = [67, 59.54, 55.74, 52.13, 49.83,42.43]
#
# #y1_8 = [68.85, 60.45, 54.27, 60.53, 56.19,58.34]
# y2_8 = [52.85, 40.09, 38.35, 42.10, 39.09,35.32]
# y3_8 = [58.0, 51.05,48.81 , 51.33, 50.22,45.77]
# y4_8 = [61.99, 51.65, 48.33, 50.46, 50.12,48.89]#
# y5_8 = [63.86, 55.76, 49.85, 50.79, 50.38,48.74]
#
# # 创建画布和子图
# fig, axs = plt.subplots(2, 4,figsize=(20, 8))
# # 在第一个子图中绘制折线图
#
# axs[0, 0].set_xlim(0, 5)
# axs[0, 0].set_ylim(0, 70)
# axs[0, 0].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[0, 0].plot(x, y1, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# axs[0, 0].plot(x, y2, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# # #
# axs[0, 0].plot(x, y3, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[0, 0].plot(x, y4, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[0, 0].plot(x, y5, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
# axs[0, 0].set_ylabel('AUC (%)',fontsize=20) # 设置纵坐标的名称
# axs[0, 0].set_title('Saturation',fontsize=20)
# axs[0, 0].tick_params(axis='x', labelsize=15)
# axs[0, 0].tick_params(axis='y', labelsize=15)
#
# # 在第二个子图中绘制折线图
# #axs[0, 1] = plt.subplot(gs[1])
# axs[0, 1].set_xlim(0, 5)
# axs[0, 1].set_ylim(0, 70)
# axs[0, 1].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[0, 1].plot(x, y1_2, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# # #
# axs[0, 1].plot(x, y2_2, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# # #
# axs[0, 1].plot(x, y3_2, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[0, 1].plot(x, y4_2, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[0, 1].plot(x, y5_2, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[0, 1].set_title('Contrast',fontsize=20)
# axs[0, 1].tick_params(axis='x', labelsize=13)
# axs[0, 1].tick_params(axis='y', labelsize=13)
#
# # 在第三个子图中绘制折线图
# #axs[0, 2] = plt.subplot(gs[2])
# axs[0, 2].set_xlim(0, 5)
# axs[0, 2].set_ylim(0, 70)
# axs[0, 2].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[0, 2].plot(x, y1_3, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# # #
# axs[0, 2].plot(x, y2_3, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# axs[0, 2].plot(x, y3_3, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[0, 2].plot(x, y4_3, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[0, 2].plot(x, y5_3, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[0, 2].set_title('Block-wise',fontsize=20)
# axs[0, 2].tick_params(axis='x', labelsize=13)
# axs[0, 2].tick_params(axis='y', labelsize=13)
# ###
# #axs[0, 3] = plt.subplot(gs[3])
# axs[0, 3].set_xlim(0, 5)
# axs[0, 3].set_ylim(0, 70)
# axs[0, 3].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[0, 3].plot(x, y1_4, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# # #
# axs[0, 3].plot(x, y2_4, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# # #
# axs[0, 3].plot(x, y3_4, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[0, 3].plot(x, y4_4, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[0, 3].plot(x, y5_4, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[0, 3].set_title('Gaussian Noise',fontsize=20)
# axs[0, 3].tick_params(axis='x', labelsize=13)
# axs[0, 3].tick_params(axis='y', labelsize=13)
# #
# # axs[1, 0] = plt.subplot(gs[4])
# axs[1, 0].set_xlim(0, 5)
# axs[1, 0].set_ylim(0, 70)
# axs[1, 0].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[1, 0].plot(x, y1_5, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
#
# axs[1, 0].plot(x, y2_5, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
#
# axs[1, 0].plot(x, y3_5, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[1, 0].plot(x, y4_5, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[1, 0].plot(x, y5_5, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
# axs[1, 0].set_ylabel('AUC (%)',fontsize=20) # 设置纵坐标的名称
# axs[1, 0].set_title('Gaussian Blur',fontsize=20)
# axs[1, 0].set_xlabel('Severity',fontsize=20) # 设置纵坐标的名称
# axs[1, 0].tick_params(axis='x', labelsize=13)
# axs[1, 0].tick_params(axis='y', labelsize=13)
# #
# axs[1, 1].set_xlim(0, 5)
# axs[1, 1].set_ylim(0, 70)
# axs[1, 1].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[1, 1].plot(x, y1_6, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
#
# axs[1, 1].plot(x, y2_6, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
#
# axs[1, 1].plot(x, y3_6, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[1, 1].plot(x, y4_6, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[1, 1].plot(x, y5_6, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[1, 1].set_title('Pixelation',fontsize=20)
# axs[1, 1].set_xlabel('Severity',fontsize=20) # 设置纵坐标的名称
# axs[1, 1].tick_params(axis='x', labelsize=13)
# axs[1, 1].tick_params(axis='y', labelsize=13)
# #
# axs[1, 2].set_xlim(0, 5)
# axs[1, 2].set_ylim(0, 70)
# axs[1, 2].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[1, 2].plot(x, y1_7, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
#
# axs[1, 2].plot(x, y2_7, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
#
# axs[1, 2].plot(x, y3_7, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[1, 2].plot(x, y4_7, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[1, 2].plot(x, y5_7, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[1, 2].set_title('JPEG Compression',fontsize=20)
# axs[1, 2].set_xlabel('Severity',fontsize=20) # 设置纵坐标的名称
# axs[1, 2].tick_params(axis='x', labelsize=13)
# axs[1, 2].tick_params(axis='y', labelsize=13)
# #
# axs[1, 3].set_xlim(0, 5)
# axs[1, 3].set_ylim(0, 70) #50 100
# axs[1, 3].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
# #axs[1, 3].plot(x, y1_8, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# axs[1, 3].plot(x, y2_8, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# axs[1, 3].plot(x, y3_8, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
# axs[1, 3].plot(x, y4_8, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
# axs[1, 3].plot(x, y5_8, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
#
# axs[1, 3].set_title('Video Compression',fontsize=25)
# axs[1, 3].set_xlabel('Severity',fontsize=25) # 设置纵坐标的名称
# axs[1, 3].tick_params(axis='x', labelsize=13)
# axs[1, 3].tick_params(axis='y', labelsize=13)
#
# extra_ax = fig.add_subplot(111, frame_on=False)
# extra_ax.tick_params(labelcolor='none', top=False, bottom=False, left=False, right=False)
# extra_ax.set_xlabel('') # 清空X轴标签
# extra_ax.set_ylabel('') # 清空Y轴标签
# extra_ax.set_title('') # 清空标题
# extra_ax.spines['top'].set_visible(False)
# extra_ax.spines['bottom'].set_visible(False)
# extra_ax.spines['left'].set_visible(False)
# extra_ax.spines['right'].set_visible(False)
# extra_ax.set_ylim(0, 0.8) # 调整Y轴范围以增加空白间距
# extra_ax = fig.add_subplot(111, frame_on=False)
# extra_ax.tick_params(labelcolor='none', top=False, bottom=False, left=False, right=False)
# extra_ax.set_xlabel('') # 清空X轴标签
# extra_ax.set_ylabel('') # 清空Y轴标签
# extra_ax.set_title('') # 清空标题
# extra_ax.spines['top'].set_visible(False)
# extra_ax.spines['bottom'].set_visible(False)
# extra_ax.spines['left'].set_visible(False)
# extra_ax.spines['right'].set_visible(False)
# extra_ax.set_ylim(0, 0.8) # 调整Y轴范围以增加空白间距
#
# # 在画布的上方横向放置图例
# lines = [axs[0, 0].get_lines()[0], axs[0, 0].get_lines()[1], axs[0, 0].get_lines()[2],axs[0, 0].get_lines()[3]]
# legend= plt.legend(lines, [ 'CViT', 'CrossViT','EViT','CAEL(Ours)'], loc='lower center',ncol=5,prop={'size': 25})
#
# # 调整图例的位置
# legend.set_bbox_to_anchor((0.5, 1.05))
# plt.axis('off')
# # 显示图形
# plt.show()
# plt.savefig("/Users/zyn/Desktop/TIFS/Fig15.", format="png",dpi=300,bbox_inches='tight')
#
# # 隐藏最后一个子图
# #axs[1, 3]≈
# # axs[1, 1].plot(x, y1, linestyle='-', marker='>', color='blue', label='折线1')
# # # #
# # axs[1, 1].plot(x, y2, linestyle='-', marker='o', color='red', label='折线1')
# # # #
# # axs[1, 1].plot(x, y3, linestyle='-', marker='s', color='green', label='折线1')
# # axs[1, 1].plot(x, y4, linestyle='-', marker='<', color='yellow', label='折线1')
# # axs[1, 1].plot(x, y5, linestyle='-', marker='^', color='black', label='折线1')
# # axs[1, 1].set_title('Gaussian Noise')
# # 添加额外的子图
# # axs[2,0].axis('off')
# # axs[2,1].axis('off')
# # axs[2,2].axis('off')
# # axs[2,3].axis('off')
#
import numpy as np
import math
import matplotlib.pyplot as plt
from matplotlib import font_manager
plt.rcParams['font.family'] = 'Times New Roman'
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.gridspec as gridspec
# 数据准备
# x1 = np.arange(1, 6) # 创建从 1 到 5 的数组 CC:contrast VC:video compression GN:gaussian noise GB:gaussian blur CS:saturation BW:block-wise GNC: pixelation
# y11 = np.arange(50, 101, 10) # 创建从 50 到 100,间隔为 10 的数组 saturation里面的数据
x = [0,1, 2, 3, 4, 5]
#y1 = [54, 44.66, 44.72, 38.08, 40.13,37.45] #xception
y2 = [64.91,55.61, 57.19,56.51,63.19,71.33] # CViT
y3 = [58.32,49.09,47.27,37.30,34.24,57.59] # crossvit
y4 = [75.89,73.51,77.06,78.49,74.73,48.57] # evit 43,33.34,45.64, 34.41, 40.04,38.58
y5 = [78.99,61.44, 67.54, 65.77, 71.91, 77.04] #ours
#第二组 contrast里数据
#y1_2 = [61, 53.82, 50.95, 47.47, 38.93,31.14] #
y2_2 = [64.91,61.05,59.86,62.63,56.31,56.20]
y3_2 = [58.32,53.97,60.32,59.85,63.04,66.23]
y4_2 = [75.89,51.31,61.50,67.69,66.25,69.53]#60, 50.91, 48.28, 30.86, 28.01,24.24
y5_2 = [78.99,60.15,64.69,66.07,65.35,57.04]
#y1_3 = [63, 57.21, 58.87, 59.83, 55.44,55.20]
y2_3 = [64.91,64.54,66.25,65.90,68.11,57.73]
y3_3 = [58.32,43.69,44.07,50.70,55.19,52.70]
y4_3 = [75.89,49.11,42.01,42.27,46.95,52.88] #
y5_3 = [78.99,61.12,62.40,66.08,69.93,58.63]
#y1_4 = [20, 9.81, 1.7, 0.7, 0.11,0.02]
y2_4 = [64.91,41.91,41.69,56.98,68.77,73.73]
y3_4 = [58.32,29.98,22.22,31.81,44.17,29.53]
y4_4 = [75.89,44.61,39.17,56.69,64.68,69.72]#31, 21.52, 6.1, 0.9, 0.3,0.2
y5_4 = [78.99,43.71,43.41,58.29,70.35,75.48]
#y1_5 = [67, 61.28, 57.58, 55.90, 56.72,50.58]
y2_5 = [64.91,62.36,66.85,57.78,65.11,64.73]
y3_5 = [58.32,56.19,50.98,54.93,52.52,47.00]
y4_5 = [75.89,55.73,66.49,56.77,63.25,61.65]#
y5_5 = [78.99,61.12,62.40,64.61,65.57,67.45]
#y1_6 = [56.3, 46.2, 45.3, 43.2, 35.1,25.3]
y2_6 = [64.91, 52.83, 47.52, 46.31, 39.10,29.20] #pixcel
y3_6 = [58.32, 42.37, 40.89, 36.51, 25.78,16.3]
y4_6 = [75.89,54.17,48.98,47.95,38.05,29.89]#
y5_6 = [78.99,56.34,49.56,48.34,40.54,30.98]
#y1_8 = [68.85, 60.45, 54.27, 60.53, 56.19,58.34]VC
y2_8 = [64.91,57.02,58.48,64.47,59.96,62.93]
y3_8 = [58.32,48.77,54.75,49.27,52.55,51.88]
y4_8 = [75.89,47.86,57.18,50.74,58.39,57.85]#
y5_8 = [78.99,61.28,49.15,61.35,64.14,60.17]
# #y1_7 = [64, 54.65, 56.97, 55.93, 58.59,59.89] jpeg
# y2_7 = [64.54,65.09,61.91,62.28,60.57,60.94]
# y3_7 = [66.19,56.65,53.53,50.99,50.40,50.30]
# y4_7 = [65.13,55.49,56.87,69.09,60.46,64.15] #
# y5_7 = [70.14,63.78,65.66,64.57,62.55,63.25]
# 定义两个列表
# 使用列表推导式计算对应位置元素的平均值,并放入新列表
y2_7 = [(a + b+c+d+e+f+g) / 7 for a, b,c,d,e,f,g in zip(y2, y2_2,y2_3,y2_4,y2_5,y2_6,y2_8)]
y3_7 = [(a + b+c+d+e+f+g) / 7 for a, b,c,d,e,f,g in zip(y3, y3_2,y3_3,y3_4,y3_5,y3_6,y3_8)]
y4_7 = [(a + b+c+d+e+f+g) / 7 for a, b,c,d,e,f,g in zip(y4, y4_2,y4_3,y4_4,y4_5,y4_6,y4_8)]
y5_7 = [(a + b+c+d+e+f+g) / 7 for a, b,c,d,e,f,g in zip(y5, y5_2,y5_3,y5_4,y5_5,y5_6,y5_8)]
# 输出新列表
# 创建画布和子图
fig, axs = plt.subplots(2, 5,figsize=(25, 8))
# 在第一个子图中绘制折线图
axs[0, 0].set_xlim(0, 5)
axs[0, 0].set_ylim(0, 90)
axs[0, 0].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[0, 0].plot(x, y1, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
axs[0, 0].plot(x, y2, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# #
axs[0, 0].plot(x, y3, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[0, 0].plot(x, y4, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[0, 0].plot(x, y5, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[0, 0].set_ylabel('AUC (%)',fontsize=25) # 设置纵坐标的名称
axs[0, 0].set_title('Saturation',fontsize=25)
axs[0, 0].tick_params(axis='x', labelsize=13)
axs[0, 0].tick_params(axis='y', labelsize=13)
# 在第二个子图中绘制折线图
#axs[0, 1] = plt.subplot(gs[1])
axs[0, 1].set_xlim(0, 5)
axs[0, 1].set_ylim(0, 90)
axs[0, 1].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[0, 1].plot(x, y1_2, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# #
axs[0, 1].plot(x, y2_2, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# #
axs[0, 1].plot(x, y3_2, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[0, 1].plot(x, y4_2, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[0, 1].plot(x, y5_2, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[0, 1].set_title('Contrast',fontsize=25)
axs[0, 1].tick_params(axis='x', labelsize=13)
axs[0, 1].tick_params(axis='y', labelsize=13)
# 在第三个子图中绘制折线图
#axs[0, 2] = plt.subplot(gs[2])
axs[0, 2].set_xlim(0, 5)
axs[0, 2].set_ylim(0, 90)
axs[0, 2].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[0, 2].plot(x, y1_3, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# #
axs[0, 2].plot(x, y2_3, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
axs[0, 2].plot(x, y3_3, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[0, 2].plot(x, y4_3, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[0, 2].plot(x, y5_3, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[0, 2].set_title('Block-wise',fontsize=25)
axs[0, 2].tick_params(axis='x', labelsize=13)
axs[0, 2].tick_params(axis='y', labelsize=13)
###
#axs[0, 3] = plt.subplot(gs[3])
axs[0, 3].set_xlim(0, 5)
axs[0, 3].set_ylim(0, 90)
axs[0, 3].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[0, 3].plot(x, y1_4, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# #
axs[0, 3].plot(x, y2_4, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# #
axs[0, 3].plot(x, y3_4, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[0, 3].plot(x, y4_4, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[0, 3].plot(x, y5_4, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[0, 3].set_title('Gaussian Noise',fontsize=25)
axs[0, 3].tick_params(axis='x', labelsize=13)
axs[0, 3].tick_params(axis='y', labelsize=13)
axs[0, 3].set_xlim(0, 5)
axs[0, 3].set_ylim(0, 90)
axs[0, 3].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[0, 3].plot(x, y1_4, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
# #
axs[0, 3].plot(x, y2_4, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
# #
axs[0, 3].plot(x, y3_4, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[0, 3].plot(x, y4_4, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[0, 3].plot(x, y5_4, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[0, 3].set_title('Gaussian Noise',fontsize=25)
axs[0, 3].tick_params(axis='x', labelsize=13)
axs[0, 3].tick_params(axis='y', labelsize=13)
# axs[1, 0] = plt.subplot(gs[4])
axs[1, 0].set_xlim(0, 5)
axs[1, 0].set_ylim(0, 90)
axs[1, 0].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[1, 0].plot(x, y1_5, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
axs[1, 0].plot(x, y2_5, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
axs[1, 0].plot(x, y3_5, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[1, 0].plot(x, y4_5, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[1, 0].plot(x, y5_5, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[1, 0].set_ylabel('AUC (%)',fontsize=25) # 设置纵坐标的名称
axs[1, 0].set_title('Gaussian Blur',fontsize=25)
axs[1, 0].set_xlabel('Severity',fontsize=25) # 设置纵坐标的名称
axs[1, 0].tick_params(axis='x', labelsize=13)
axs[1, 0].tick_params(axis='y', labelsize=13)
#
axs[1, 1].set_xlim(0, 5)
axs[1, 1].set_ylim(0, 90)
axs[1, 1].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[1, 1].plot(x, y1_6, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
axs[1, 1].plot(x, y2_6, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
axs[1, 1].plot(x, y3_6, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[1, 1].plot(x, y4_6, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[1, 1].plot(x, y5_6, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[1, 1].set_title('Pixelation',fontsize=25)
axs[1, 1].set_xlabel('Severity',fontsize=25) # 设置纵坐标的名称
axs[1, 1].tick_params(axis='x', labelsize=13)
axs[1, 1].tick_params(axis='y', labelsize=13)
#
axs[1, 3].set_xlim(0, 5)
axs[1, 3].set_ylim(0, 90)
axs[1, 3].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[1, 2].plot(x, y1_7, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
axs[1, 3].plot(x, y2_7, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
axs[1, 3].plot(x, y3_7, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[1, 3].plot(x, y4_7, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[1, 3].plot(x, y5_7, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[1, 3].set_title('Average',fontsize=25)
axs[1, 3].set_xlabel('Severity',fontsize=25) # 设置纵坐标的名称
axs[1, 3].tick_params(axis='x', labelsize=13)
axs[1, 3].tick_params(axis='y', labelsize=13)
#
axs[1, 2].set_xlim(0, 5)
axs[1, 2].set_ylim(0, 90) #50 100
axs[1, 2].set_xticks(np.arange(0, 6)) # 设置 x 轴的刻度位置
#axs[1, 3].plot(x, y1_8, linestyle='-', linewidth=3,marker='>',markersize=12, color='blue', label='Saturation')
axs[1, 2].plot(x, y2_8, linestyle='--', linewidth=3, marker='*', markersize=12,color='red', label='Contrast')
axs[1, 2].plot(x, y3_8, linestyle='--', linewidth=3,marker='s', markersize=12,color='green', label='折线1')
axs[1, 2].plot(x, y4_8, linestyle=':', linewidth=3,marker='o', markersize=12,color='c', label='折线1')
axs[1, 2].plot(x, y5_8, linestyle='-', linewidth=3,marker='^', markersize=12,color='black', label='折线1')
axs[1, 2].set_title('Video Compression',fontsize=25)
axs[1, 2].set_xlabel('Severity',fontsize=25) # 设置纵坐标的名称
axs[1, 2].tick_params(axis='x', labelsize=13)
axs[1, 2].tick_params(axis='y', labelsize=13)
axs[1, 4].set_xlim(0, 5)
axs[1, 4].set_ylim(0, 70)
axs[1, 4].set_xticks(np.arange(0, 6))
axs[1, 4].plot(x, y5, linestyle='-', linewidth=3, marker='^', markersize=12, color='black', label='Ours')
axs[1, 4].set_title('Saturation', fontsize=20)
axs[1, 4].set_xlabel('Severity', fontsize=20)
axs[1, 4].tick_params(axis='x', labelsize=13)
axs[1, 4].tick_params(axis='y', labelsize=13)
# Create a clean empty subplot for extra formatting
extra_ax = fig.add_subplot(111, frame_on=False)
extra_ax.tick_params(labelcolor='none', top=False, bottom=False, left=False, right=False)
extra_ax.set_xlabel('') # Remove X-axis label
extra_ax.set_ylabel('') # Remove Y-axis label
extra_ax.set_title('') # Remove title
extra_ax.spines['top'].set_visible(False)
extra_ax.spines['bottom'].set_visible(False)
extra_ax.spines['left'].set_visible(False)
extra_ax.spines['right'].set_visible(False)
extra_ax.set_ylim(0, 0.8) # Adjust Y-axis range for white space
# extra_ax = fig.add_subplot(111, frame_on=False)
# extra_ax.tick_params(labelcolor='none', top=False, bottom=False, left=False, right=False)
# extra_ax.set_xlabel('') # 清空X轴标签
# extra_ax.set_ylabel('') # 清空Y轴标签
# extra_ax.set_title('') # 清空标题
# extra_ax.spines['top'].set_visible(False)
# extra_ax.spines['bottom'].set_visible(False)
# extra_ax.spines['left'].set_visible(False)
# extra_ax.spines['right'].set_visible(False)
# extra_ax.set_ylim(0, 0.8) # 调整Y轴范围以增加空白间距
# extra_ax = fig.add_subplot(111, frame_on=False)
# extra_ax.tick_params(labelcolor='none', top=False, bottom=False, left=False, right=False)
# extra_ax.set_xlabel('') # 清空X轴标签
# extra_ax.set_ylabel('') # 清空Y轴标签
# extra_ax.set_title('') # 清空标题
# extra_ax.spines['top'].set_visible(False)
# extra_ax.spines['bottom'].set_visible(False)
# extra_ax.spines['left'].set_visible(False)
# extra_ax.spines['right'].set_visible(False)
# extra_ax.set_ylim(0, 0.8) # 调整Y轴范围以增加空白间距
# 在画布的上方横向放置图例
lines = [axs[0, 0].get_lines()[0], axs[0, 0].get_lines()[1], axs[0, 0].get_lines()[2],axs[0, 0].get_lines()[3]]
legend= plt.legend(lines, ['FreqNet','CLIP','DIRE','MFVRL (Ours)'], loc='lower center',ncol=5,prop={'size': 25})
# 调整图例的位置
legend.set_bbox_to_anchor((0.5, 1.05))
plt.axis('off')
# 显示图形
plt.show()
#plt.savefig("/Users/zyn/Desktop/IEEE-Transactions-LaTeX2e-templates-and-instructions (1)/Figrobust.png", format="png",dpi=300,bbox_inches='tight')
# 隐藏最后一个子图
#axs[1, 3]≈
# axs[1, 1].plot(x, y1, linestyle='-', marker='>', color='blue', label='折线1')
# # #
# axs[1, 1].plot(x, y2, linestyle='-', marker='o', color='red', label='折线1')
# # #
# axs[1, 1].plot(x, y3, linestyle='-', marker='s', color='green', label='折线1')
# axs[1, 1].plot(x, y4, linestyle='-', marker='<', color='yellow', label='折线1')
# axs[1, 1].plot(x, y5, linestyle='-', marker='^', color='black', label='折线1')
# axs[1, 1].set_title('Gaussian Noise')
# 添加额外的子图
# axs[2,0].axis('off')
# axs[2,1].axis('off')
# axs[2,2].axis('off')
# axs[2,3].axis('off') |