Export a figure:
function createfigure(YMatrix1,YMatrix2,YMatrix3)
%CREATEFIGURE(YMATRIX1)
% YMATRIX1\2\3: y 数据的矩阵
% 创建 figure
figure1 = figure;
% 创建 axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
grid(axes1,'on');
hold(axes1,'all');
% 使用 plot 的矩阵输入创建多行
plot(YMatrix1,'o-b','Parent',axes1);
plot(YMatrix2,'^-r','Parent',axes1);
plot(YMatrix3,'-sg','Parent',axes1);
% 创建 xlabel,ylabel
x=xlabel('$$n_0$$');
y=ylabel('$$P_c$$');
% 创建 legend
legend1 = legend('\it{Bit}','\it{Pixel}','\it{Permutation matrix}');
% 设置样式
set(gca,'fontsize',11);
set(gca,'Fontname','times new Roman');
set(legend1,'Location','SouthEast');
set(x,'Interpreter','LaTex');
set(y,'Interpreter','LaTex');
set(get(gca,'xlabel'),'FontSize',14);
set(get(gca,'ylabel'),'FontSize',14);
Remove backgrounds:
set(gcf,'color','none'); %图形背景设为无色
set(gca,'color','none'); %坐标轴背景设为无色,这条更重要,通常图形背景的白色实际为坐标轴背景色
来源:oschina
链接:https://my.oschina.net/u/2323166/blog/632077