forked from rozenasf/Matlab2Powerpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTXYL.m
More file actions
55 lines (55 loc) · 1.44 KB
/
TXYL.m
File metadata and controls
55 lines (55 loc) · 1.44 KB
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
function TXYL(Title,Xlabel,Ylabel,varargin)
if(exist('Title') && ~isempty(Title))
if((~iscell(Title) && Title(1)=='$') || (iscell(Title) && Title{1}(1)=='$'))
title(Title,'Interpreter','latex');
else
title(Title);
end
end
if(exist('Xlabel') && ~isempty(Xlabel))
if(Xlabel(1)=='$')
xlabel(Xlabel,'Interpreter','latex');
else
xlabel(Xlabel);
end
end
if(exist('Ylabel') && ~isempty(Ylabel))
if(Ylabel(1)=='$')
ylabel(Ylabel,'Interpreter','latex');
else
ylabel(Ylabel);
end
end
if(numel(varargin)>0)
if(iscell(varargin{2}))
Legend={};
for i=1:numel(varargin{2}{1})
Legend{i}=sprintf(varargin{1},varargin{2}{1}(i));
end
Location='northeast';
for k=3:numel(varargin)
if(strcmp( varargin{k},'location'));
Location=varargin{k+1};
k=k-1;
break;
end
end
legend(Legend,'Interpreter','latex','location',Location);
else
Location='northeast';
for k=1:numel(varargin)
if(strcmp( varargin{k},'location'));
Location=varargin{k+1};
k=k-1;
break;
end
end
legend(varargin(1:k),'location',Location);%'Interpreter','latex',
end
end
Ax=gca;Ax.FontName='Times New Roman';Ax.FontSize=16;
Fx=gcf;Fx.Color='w';
Ax=gca;Ax.LineWidth=2;
Ax.YColor=[0,0,0];
Ax.XColor=[0,0,0];
end