How can I maintain title size when creating report snapshot

6 views (last 30 days)
I am using the following code to print a figure into a .pdf report, using Matlab Report Generator
figure(LCAPlot),
set(LCAPlot, 'Position', [50, 50, 1400, 600])
figure1 = Figure(LCAPlot);
Print=Image(getSnapshotImage(figure1, FinalReport));
Print.Style = {ScaleToFit(true)};
However, the title of the figure always keeps the same size in the pdf report, even when I increase it on the Matlab figure.
Is there a property that can maintain the set title size ?
Matlab window Figure
Report Figure
  4 Comments
Eric
Eric on 29 Apr 2019
I'm not entirely sure what you mean by layout tables. Are you using tables to layout images so that they are side-by-side? If so, that should work.
I need to see some sample code, to figure out what went wrong.
CelCet
CelCet on 30 Apr 2019
Indeed, the tables to layout images side-by-side also work this way. My mistake !
So printing the image this way is a good solution for my report. Thank you for the suggestion.
To compare with the Figure report, see the code below :
import mlreportgen.dom.*;
import mlreportgen.report.*;
MyReport = Report(['ExampleReport'],'pdf');
x = 0:pi/100:2*pi;
F1=figure;
plot(x,sin(x)),title('Title of the Plot','FontSize',25);
ch1 = Chapter("Title", "correct");
print(F1, '-dsvg', 'F1plot.svg');
Print = Image('F1plot.svg');
Print.Style = {ScaleToFit(true)};
add(ch1,Print);
add(MyReport,ch1);
ch2 = Chapter("Title", "title too small");
figure1 = Figure(F1);
Print=Image(getSnapshotImage(figure1, MyReport));
Print.Style = {ScaleToFit(true)};
add(ch2,Print);
add(MyReport,ch2);
rptview(MyReport);

Sign in to comment.

Answers (0)

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!