How can I maintain title size when creating report snapshot

5 次查看(过去 30 天)
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 个评论
Eric
Eric 2019-4-29
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 2019-4-30
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);

请先登录,再进行评论。

回答(0 个)

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by