1. %% 创建存放写出图像的文件夹
    2. dirname = 'Result';
    3. mkdir(dirname);
    4. %% 绘制时间序列对比图
    5. % fig = figure;
    6. fig = figure('Visible','off'); % 不显示绘图图窗
    7. set(gcf,'Position',get(0,'ScreenSize')); % 设置绘图为全屏绘制
    8. set(gca,'FontSize',20); % 设置plot横纵轴数字字体大小,注意这是全局字体大小设置,需要在标题大小设置的前面,否则会覆盖
    9. % 绘制 NDVI 的时间序列图
    10. p1=plot(ts_16d,NDVI_16d_3_years(poi,:),':*y','MarkerSize',10,'MarkerFaceColor','w');
    11. p1.LineWidth=2;
    12. % % 标题和坐标轴区域
    13. % title_name = ['Original vs Reconstruction(iHANTS, POI-',num2str(POI_FID(poi)+1),', ',LC_name,')'];
    14. % title(title_name,'FontName','Times New Roman','FontSize',25);
    15. % % 字体是Times New Roman,颜色是蓝色('b'blue),字体大小是20号。
    16. xlim=[0,70]; ylim=[0,1];
    17. set(gca,'xtick',0:2:70,'FontSize',15) % handles可以指定具体坐标轴的句柄
    18. set(gca,'ytick',0:0.1:1,'FontSize',15) % handles可以指定具体坐标轴的句柄
    19. axis([0 70 0 1]);%axis([xmin xmax ymin ymax]),设置绘制区域的范围
    20. %% 这个放在后面设置字号,否则上面会被覆盖掉
    21. xlabel('Time Series Index','FontSize',20,'FontWeight','bold');
    22. ylabel('NDVI','FontSize',20,'FontWeight','bold'); %设置横纵轴名称及字体大小
    23. % 绘制 NDVI 时间序列图
    24. % 绘制 NDVI 时间序列图
    25. hold on;
    26. p2=plot(ts_16d,yr_16d_3_years1,'--.c','MarkerSize',8);
    27. p2.LineWidth=2;
    28. hold on;
    29. p3=plot(ts_16d,yr_16d_3_years2,'--.g','MarkerSize',8);
    30. p3.LineWidth=2;
    31. hold on;
    32. p4=plot(ts_16d,yr_16d_3_years3,'--.b','MarkerSize',8);
    33. p4.LineWidth=2;
    34. hold on;
    35. p5=plot(ts_16d,yr_16d_3_years4,'--.m','MarkerSize',8);
    36. p5.LineWidth=2;
    37. hold on;
    38. p6=plot(ts_16d,yr_16d_3_years5,'--.r','MarkerSize',8);
    39. p6.LineWidth=2;
    40. hold on;
    41. % p7=plot(ts_16d,yr_16d_3_years6,'--.k','MarkerSize',8);
    42. % p7.LineWidth=2;
    43. hold on;
    44. line([24 24],[0 0.9],'linestyle',':', 'Color','k', 'LineWidth', 3);
    45. hold on;
    46. line([46 46],[0 0.9],'linestyle',':', 'Color','k', 'LineWidth', 3);
    47. %% 标注高质量点
    48. for marker_index = 1:length(y_QC_3_years)
    49. if y_QC_3_years(marker_index)==1
    50. hold on;
    51. p8=plot(ts_16d(marker_index),NDVI_16d_3_years(poi,marker_index),...
    52. 'kp','MarkerSize',20,'LineWidth',2);
    53. end
    54. end
    55. %% 绘制图例
    56. % leg=legend({'16d (Original, 3 years)','16d (Reconstructed, 3 years)',...
    57. % '16d (Original,1 year)','16d (Reconstructed, 1 year)'},'Location','northeast');
    58. leg=legend([p1,p2,p3,p4,p5,p6,p8],{'Original','delta=0.1','delta=0.2',...
    59. 'delta=0.3', 'delta=0.4','delta=0.5','delta=0.6','High Quality Points'},...
    60. 'Location','northoutside','Orientation','horizontal');
    61. legend('boxoff'); % 不显示图例框
    62. set(leg,'FontName','Times New Roman','FontSize',18,'FontWeight','normal')
    63. %% 写出对比图像
    64. img_name = ['.\',dirname,'\POI_',num2str(POI_index(poi)),'-',LC_name]; % 写出到dir_name文件夹中
    65. print(img_name, '-dpng', '-r0'); % 保存到工作目录下,名字为img_name
    66. % catch
    67. % fprintf(['POI_',num2str(POI_FID(poi)+1),' has some problems!\n']);
    68. % end
    69. end
    70. %% 关闭绘图
    71. close all;