reporting (WIP)
parent
1c371389df
commit
16aebf892c
|
@ -3,10 +3,10 @@ function o = createGraph(o)
|
|||
% Create the graph
|
||||
%
|
||||
% INPUTS
|
||||
% none
|
||||
% o - Graph Object
|
||||
%
|
||||
% OUTPUTS
|
||||
% none
|
||||
% o - Graph Object
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
@ -37,9 +37,14 @@ end
|
|||
|
||||
%o = readConfig(o);
|
||||
|
||||
disp('creating plot..........');
|
||||
h = figure('visible','off');
|
||||
hold on;
|
||||
box on;
|
||||
if o.grid
|
||||
grid on;
|
||||
set(gca, 'GridLineStyle', '--');
|
||||
end
|
||||
%set(0, 'CurrentFigure',h);
|
||||
%set(h, 'PaperPositionMode', 'auto');
|
||||
%set(h, 'units', 'normalized', 'outerposition', [0 0 1 1]);
|
||||
|
@ -90,16 +95,18 @@ if ~isempty(o.ylabel)
|
|||
end
|
||||
|
||||
if ~isempty(o.title)
|
||||
title(['$\textbf{\large ' o.title '}$'],'Interpreter','LaTex');
|
||||
title( o.title , 'interpreter', 'none', 'FontSize', 20);
|
||||
end
|
||||
drawnow;
|
||||
|
||||
o.figname = ['figure-' num2str(cputime) '.tex'];
|
||||
disp(' converting to tex....');
|
||||
matlab2tikz('filename', o.figname, ...
|
||||
'showInfo', false, ...
|
||||
'showWarnings', false, ...
|
||||
'checkForUpdates', false);
|
||||
|
||||
grid off;
|
||||
box off;
|
||||
hold off;
|
||||
close(h);
|
||||
|
|
|
@ -44,6 +44,8 @@ o.data = '';
|
|||
o.seriestoplot = 'all';
|
||||
o.shade = ''; %{1959q1:1964q4}
|
||||
|
||||
o.grid = true;
|
||||
|
||||
o.legend = false;
|
||||
o.legend_location = 'SouthEast';
|
||||
o.legend_orientation = 'horizontal';
|
||||
|
|
|
@ -33,6 +33,7 @@ o = struct;
|
|||
o.paper = '';
|
||||
o.title = '';
|
||||
o.orientation = '';
|
||||
o.footnote = '';
|
||||
o.sections = sections();
|
||||
|
||||
if nargin == 1
|
||||
|
|
|
@ -32,8 +32,15 @@ assert(fid ~= -1);
|
|||
|
||||
fprintf(fid, '\n%% Page Object\n');
|
||||
if ~isempty(o.title)
|
||||
fprintf(fid, '\\centerline{{\\Large %s}}\n', o.title);
|
||||
fprintf(fid, '\\centerline{\\large\\textbf{%s}}\n', o.title);
|
||||
end
|
||||
|
||||
if ~isempty(o.footnote)
|
||||
for i=1:length(o.footnote)
|
||||
fprintf(fid, '\\blfootnote{\\tiny %d. %s}', i, o.footnote{i});
|
||||
end
|
||||
end
|
||||
|
||||
if strcmpi(o.orientation, 'landscape')
|
||||
fprintf(fid, '\\begin{landscape}\n')
|
||||
end
|
||||
|
|
|
@ -34,10 +34,11 @@ o = struct;
|
|||
o.title = '';
|
||||
o.orientation = 'portrait';
|
||||
o.paper = 'a4';
|
||||
o.margin = '2cm';
|
||||
o.margin = '2.5cm';
|
||||
o.pages = pages();
|
||||
o.filename = 'report.tex';
|
||||
o.config = '';
|
||||
o.showdate = true;
|
||||
|
||||
if nargin == 1
|
||||
assert(isa(varargin{1}, 'report'),['With one arg to Report constructor, ' ...
|
||||
|
|
|
@ -41,10 +41,18 @@ if strcmpi(o.orientation, 'landscape')
|
|||
fprintf(fid, ',landscape');
|
||||
end
|
||||
fprintf(fid, ']{geometry}\n');
|
||||
fprintf(fid, '\\usepackage{graphicx}\n');
|
||||
fprintf(fid, '\\usepackage{pdflscape}\n');
|
||||
fprintf(fid, '\\usepackage{pgf}\n');
|
||||
fprintf(fid, '\\usepackage{pgfplots}\n');
|
||||
fprintf(fid, '\\usepackage{graphicx, pdflscape, pgf, pgfplots}\n');
|
||||
fprintf(fid, ['\\makeatletter\n' ...
|
||||
'\\def\\blfootnote{\\gdef\\@thefnmark{}\\@footnotetext}\n' ...
|
||||
'\\makeatother\n']);
|
||||
if o.showdate
|
||||
fprintf(fid, '\\usepackage{fancyhdr, datetime}\n');
|
||||
fprintf(fid, '\\newdateformat{reportdate}{\\THEDAY\\ \\shortmonthname\\ \\THEYEAR}\n');
|
||||
fprintf(fid, '\\pagestyle{fancy}\n');
|
||||
fprintf(fid, '\\renewcommand{\\headrulewidth}{0pt}\n');
|
||||
fprintf(fid, '\\renewcommand{\\footrulewidth}{0.5pt}\n');
|
||||
fprintf(fid, '\\rfoot{\\scriptsize\\reportdate\\today\\ -- \\currenttime}\n');
|
||||
end
|
||||
fprintf(fid, '\\begin{document}\n');
|
||||
|
||||
o.pages.write(fid);
|
||||
|
|
Loading…
Reference in New Issue