-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave_plot.m
More file actions
30 lines (17 loc) · 806 Bytes
/
save_plot.m
File metadata and controls
30 lines (17 loc) · 806 Bytes
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
function save_plot(file_name)
pause(0.01)
%file_name is optional - if not set the style will be applied only
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
sdf('thesis_style')
set(findall(gca, 'Type', 'Axes'),'LineWidth',2);
set(findall(gca, 'Type', 'Line'),'LineWidth',2);
set(findall(gca, 'Type', 'Axes'),'FontSize',14);
set(findall(gca, 'Type', 'Axes'),'FontWeight','Bold');
snam='Leave everything alone'; % The name of your style file (NO extension)
s=hgexport('readstyle',snam);
if exist('file_name','var')
fnam_svg=strcat(file_name, '.svg'); % your file name
s.Format = 'svg'; %I needed this to make it work but maybe you wont.
hgexport(gcf,fnam_svg, s);
end
end