MATLAB学习笔记之-----图像写入硬盘与多曲线绘图

来源:互联网 发布:大数据就业前景怎么样 编辑:程序博客网 时间:2024/05/16 14:30

原文链接:https://user.qzone.qq.com/553702786/blog/1487210628

图片存档:

imwrite(I,'./Lena.tif', 'tiff', 'Resolution',600); 
多曲线绘图:
clc;
sigma=[10,20,50,100];
psnrATV=[29.862,25.011,21.812,19.256];
psnrTGV=[29.590,25.534,21.900,19.358];
psnrQTV_GP=[30.237,25.830,22.011,19.300];
psnrQTV_SBI=[30.194,25.846,21.943,19.357];
figure (1);
h1=plot(sigma,psnrATV,'-sm','LineWidth',2);hold on;grid on;
h2=plot(sigma,psnrTGV,'--ok','LineWidth',2);hold on;grid on;
h3=plot(sigma,psnrQTV_GP,':vg','LineWidth',2);hold on;grid on;
h4=plot(sigma,psnrQTV_SBI,'-.pr','LineWidth',2);hold on;grid on;
xlabel('\sigma'); %原来在变量前面加一个斜杠就是斜体哦
ylabel('PSNR');
legend('ATV','TGV','QTV-GP','QTV-SBI');
figure (2);
ssimATV=[0.882,0.752,0.580,0.445];
ssimTGV=[0.871,0.768,0.583,0.459];
ssimQTV_GP=[0.897,0.786,0.589,0.459];
ssimQTV_SBI=[0.886,0.773,0.583,0.443];
h1=plot(sigma,ssimATV,'-sm','LineWidth',2);hold on;grid on;
h2=plot(sigma,ssimTGV,'--ok','LineWidth',2);hold on;grid on;
h3=plot(sigma,ssimQTV_GP,':vg','LineWidth',2);hold on;grid on;
h4=plot(sigma,ssimQTV_SBI,'-.pr','LineWidth',2);hold on;grid on;
xlabel('\sigma');
ylabel('SSIM');
legend('ATV','TGV','QTV-GP','QTV-SBI');
------------------------------------------------------------------
1、图形标注
有关图形标注函数的调用格式为:
title('图形名称');
xlabel('x轴说明');
ylabel('y轴说明');
text (x,y,'图形说明');
legend('图例1','图例2',…)
函数中的说明文字,除使用标准的ASCII字符外,还可使用LaTeX格式的控制字符,这样就可以在图形上添加希腊字母、数学符号及公式等内容。例如,text(0.3,0.5,‘sin({\omega}t+{\beta})’)将得到标注效果sin(ωt+β)
2、坐标控制
axis函数的调用格式为:
axis([xmin xmax ymin ymax zmin zmax])
axis函数功能丰富,常用的格式还有:
axis equal:纵、横坐标轴采用等长刻度。
axis square:产生正方形坐标系(缺省为矩形)
axis auto:使用缺省设置。
axis off:取消坐标轴。
axis on:显示 坐标轴。
给坐标加网格线用grid命令来控制。grid on/off命令控制是画还是不画网格线,不带参数的grid命令在两种状态之间进行切换。
给坐标加边框用box命令来控制。box on/off命令控制是加还是不加边框线(就是要不要右上角的边框),不带参数的box命令在两种状态之间进行切换。
t=0:0.01:2*pi;
x=exp(i*t);
y=[x;2*x;3*x]';
plot(y)
grid on; %加网格线
box on; %加坐标边框
axis equal %坐标轴采用等刻度
试试命令后的不同效果:【grid on; +box on;】 【grid off; +box on;】 【grid on; +box off;】 
0 0