MATLAB源代码如下:
x = linspace(0, 10, 100);y1 = sin(x);y2 = cos(x);
figure;fill_between(x, y1, 'FaceColor', 'blue', 'FaceAlpha', 0.4);hold on;fill_between(x, y2, 'FaceColor', 'orange', 'FaceAlpha', 0.4);title('面积图');xlabel('X轴');ylabel('Y轴');grid on;saveas(gcf, '面积图.jpg');
效果图如下: