This project is read-only.

Putting 3 graphs on one page in pdf report

Topics: Reporting
Jun 3, 2016 at 8:43 AM
Hello, guys!

Is it possible to put 3 graphs on one page in a pdf report, so that one of the graphs is twice the width of two others, i.e. there would be no blank space left for the possible forth graph.

Best,
Andrey
Jun 3, 2016 at 10:53 AM
Hi Andrey,

There are several possibilities, actually.

First,
clear all;
close all;
r = report.new();
r.figure('','subplot',[2,2]);
cmd = ['set(get(H,''parent''),''units'',''normalized'');',...
       'tmpPos = get(H,''position'');',...
       'set(H,''position'',[tmpPos(1:2),tmpPos(3)*2+0.1,tmpPos(4)])'];
r.graph('','postProcess=',cmd);
r.series('',tseries(qq(2000,1:16),@randn));
r.empty();
r.graph('');
r.series('',tseries(qq(2000,1:16),@randn));
r.graph('');
r.series('',tseries(qq(2000,1:16),@randn));
r.publish('ccc.pdf');
Second,
figure('visible','off');
subplot(2,2,1:2);
plot(tseries(qq(2000,1:16),@randn));
subplot(2,2,3);
plot(tseries(qq(2000,1:16),@randn));
subplot(2,2,4);
plot(tseries(qq(2000,1:16),@randn));
r.userfigure('',gcf);
r.publish('ccc.pdf');
Once issue issue 164 is fixed you should also be able to do it like this,
clear all;
close all;
r = report.new();
r.figure('','subplot',[2,2]);
r.graph('','postProcess=','grfun.movetosubplot(H,2,2,1:2)');
r.series('',tseries(qq(2000,1:16),@randn));
r.empty();
r.graph('');
r.series('',tseries(qq(2000,1:16),@randn));
r.graph('');
r.series('',tseries(qq(2000,1:16),@randn));
r.publish('ccc.pdf');
Jun 3, 2016 at 12:33 PM
Thank you, Sergey! Exactly what I was looking for.

Andrey