I'm trying to create a data quality report that generates automatically after I analyze a new set of data.
I want to put two imagesc figures on one page of the report. I'd like to add the figures to Section 1, Chapter 1 and so far I've found two ways to do this:
1. Create an "invisible table" and put images of each figure into the cells of the table, then add the table to the chapter section. This works, but I haven't gotten the sizing quite right to maximize the figures on the page using the following code:
import mlreportgen.report.*
rpt = Report('datarep','pdf');
tp.Title = [subject ' Data Report'];
tp.Author = 'G. Williams';
append(rpt,TableOfContents);
ch1.Title = 'Displacement Data';
ch1.Layout.Landscape = true;
sec1.Title = 'Peak Systole Displacement SI';
imgStyle = {ScaleToFit(true)};
title('Peak Systole DispX')
fig1Img = Image(getSnapshotImage(f1,rpt));
fig1Img.Style = imgStyle;
title('Peak Systole DispY')
fig2Img = Image(getSnapshotImage(f2,rpt));
fig2Img.Style = imgStyle;
lo_table = Table({fig1Img, fig2Img});
lo_table.entry(1,1).Style = {Width('4.2in'), Height('5in')};
lo_table.entry(1,2).Style = {Width('4.2in'), Height('5in')};
lo_table.Style = {Width('100%'), ResizeToFitContents(false)};
2. Using tiledlayout(), I can get the figures to look a bit nicer in the PDF and don't have to fiddle around with setting the height and width of the table to get it to look right, but the generated report has an extra blank page at the end that I don't understand, using the following code:
import mlreportgen.report.*
rpt = Report('datarep','pdf');
tp.Title = [subject ' Data Report'];
tp.Author = 'G. Williams';
append(rpt,TableOfContents);
ch1.Title = 'Displacement Data';
ch1.Layout.Landscape = true;
sec1.Title = 'Peak Systole Displacement SI';
title('Peak Systole DispX')
title('Peak Systole DispY')
t1.TileSpacing = 'tight';
I can use the code from (1), but I need to create these reports with a number of variables that will require me to reisze the tables for each variable as I have this written.
If anyone could help direct me on either fixing the code from (1) to better show the figures without having to hardcode the height/widths, or if someone can help me understand why my tiledlayout code adds a blank page to my PDF so I can stop that, or there's a way to just tell matlab to delete the blank page after its created, I would greatly appreciate it.
I've been reading through the report generator documentation, but I've never really worked with object oriented code so it's a bit of a learning curve for me.
Thank you in advance!