-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes_fixingepsExportIssues.m
117 lines (97 loc) · 3.62 KB
/
notes_fixingepsExportIssues.m
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
clf; clc; clear all;
figure_width = 8*2;
figure_height = 6*2;
FontSize = 11*1.5;
FontName = 'MyriadPro-Regular';
xaxis = linspace(0,10,50);
data1 =sin(xaxis);
data2 =sin(xaxis + 0.6);
data3 =sin(xaxis + 1.2);
hfig = figure(1); clf;
set(gcf, 'units', 'centimeters', 'pos', [0 0 figure_width figure_height])
% set(gcf, 'Units', 'pixels', 'Position', [100 100 500 375]);
set(gcf, 'PaperPositionMode', 'auto');
set(gcf, 'Color', [1 1 1]); % Sets figure background
set(gca, 'Color', [1 1 1]); % Sets axes background
set(gcf, 'Renderer', 'painters');
hLine1 = line(xaxis, data1);
hLine2 = line(xaxis, data2);
hLine3 = line(xaxis, data3);
hdots = line(xaxis, data3);
set(hLine1 , ...
'LineStyle' , '--' , ...
'LineWidth' , 2 , ...
'Color' , [0.75 0 0] );
set(hLine2 , ...
'LineStyle' , ':' , ...
'LineWidth' , 2 , ...
'Color' , [0 0 0.75] );
set(hLine3 , ...
'LineStyle' , '-' , ...
'LineWidth' , 2 , ...
'Color' , [0.5 0 0.5] );
set(hdots , ...
'LineStyle' , 'none' , ...
'Marker' , 'o' , ...
'MarkerSize' , 6 , ...
'MarkerEdgeColor' , [.5 .0 .5] , ...
'MarkerFaceColor' , [.7 .5 .7] );
hTitle = title ('test graphics');
hXLabel = xlabel('x-axis');
hYLabel = ylabel('y-axis');
hLegend = legend( ...
[hdots, hLine1, hLine2, hLine3], ...
'Data' , ...
'Model' , ...
'Fit' , ...
'Validation Data' , ...
'location', 'Best' );
%'Data (\mu \pm \sigma)' , ...
%'Model (\it{C x^3})' , ...
%'Fit (\it{C x^3})' , ...
set( gca , ...
'FontName' , FontName );
set([hTitle, hXLabel, hYLabel], ...
'FontName' , FontName);
set([hLegend, gca] , ...
'FontSize' , FontSize - 2);
set([hXLabel, hYLabel] , ...
'FontSize' , FontSize );
set( hTitle , ...
'FontSize' , FontSize , ...
'FontWeight' , 'bold' );
set(gca, ...
'Box' , 'off' , ...
'TickDir' , 'out' , ...
'TickLength' , [.02 .02] , ...
'XMinorTick' , 'on' , ...
'YMinorTick' , 'on' , ...
'YGrid' , 'on' , ...
'XColor' , [.0 .0 .0], ...
'YColor' , [.0 .0 .0], ...
'YTick' , -1:0.5:1, ...
'LineWidth' , 1.0 );
% print(gcf, '-r300', 'matlab_opengl.png', '-dpng');
% print(gcf, '-r300', 'matlab_opengl.pdf', '-dpdf');
% print(gcf, '-r300', 'matlab_opengl.eps', '-depsc');
% ghostscriptConvertTo('png', 'matlab_opengl.eps', 'matlab_opengl.eps.png')
% print(gcf, '-r300', 'matlab_painters.png', '-dpng');
% print(gcf, '-r300', 'matlab_painters.pdf', '-dpdf');
% print(gcf, '-r300', 'matlab_painters.eps', '-depsc');
% ghostscriptConvertTo('png', 'matlab_painters.eps', 'matlab_painters.eps.png')
%
% savefig('savefig', 'pdf', 'png', 'eps', '-fonts');
%
% export_fig('exportfig_painters.pdf', '-pdf', '-painters');
% export_fig('exportfig_painters.eps', '-eps', '-painters');
% export_fig('exportfig_painters.png', '-png', '-painters', '-r300');
%
% export_fig('exportfig_opengl.png', '-png', '-opengl', '-r300');
%
% plot2svg('plot2svg.svg', hfig);
% matlabfrag('matlabfrag.eps','handle',hfig) ;
% mlf2pdf(gcf,'matlabfrag');
% latexPackages = ['\renewcommand{\sfdefault}{pmy}\n \renewcommand{\rmdefault}{pmy}'];
% latexfigure(hfig,'latexfigure','eps',latexPackages);
% latexfigure(hfig,'latexfigure','png',latexPackages);
% latexfigure(hfig,'latexfigure','pdf',latexPackages);