How to preserve font size of plots during report generation in MATLAB? - matlab

Is there a way to preserve font size in plots when using report generation?
I update the fontsize of figures to 14 before making a report but the following instructions in Matlab during reporting create a temporary snapshot with the default font size of 12.
figReporter = Figure("Source",figure(n),"SnapshotFormat","png");
imgPath = getSnapshotImage(figReporter,rpt);
Can anyone suggest how to approach this and generate reports with the updated font size in plots?
The plots below show the difference before and after the report generation. The font size reduces when checked in the report generated.

Related

Font size problem for a Matlab figure in a template

I know this is a topic that is closed but I am struggling to put a MATLAB figure in a beamer template with the adequate font size.
I started to use the Export setup of MATLAB to adjust the dimensions of my figure and also the font size which is 12 pts :
This size is chosen because the font size of a frame title appears to be this value.
Then, I save it as an eps file and I check the dimensions with Inkscape : everything seems to be correct.
But when loading it in my beamer template, the font size seems to not be adequate anymore (see the difference between the font size of the title and the font size of the figure):
My coding is very basic since I am just loading my eps file in LaTex document after conversion to PDF \usepackage{epstopdf} :
\includegraphics[width=1 \linewidth]{pic/test.eps}
Is there a simple way to make the font size of the figure similar to the font size of the title ?
Thank you for your help,

How do you auto size columns of a grid for PDF format in Birt reporting

I am working on a report in Birt reporting using Birt 4.5 in eclipse.
I have a grid that has 3 columns and inside each column is a label with some hard coded value to give you a test scenario,I also set the "Can shrink" property to true, and I did change the layout Preference to auto-Layout, see pic bellow.
Now when I run this example as a Html out of eclipse I get the following and it works exactly like I want it to. It auto sizes the columns so the first column size has increased and the last 2 decreased.
Html pic :
Now I actually want it as a PDF format but the columns doesn't auto resize.
PDF pic :
I want this functionality because my report is going to be dynamic.
Is it possible to get the same result in the pdf format as html? If it is what properties should I set or how do I accomplish this?
No, this is not possible.
Those columns with no width specified (in your example: all three) take the remaining width (after considering the columns with a specified width) to equal parts.

Matlab figure size formatting for Word

I'm trying to create MATLAB figures to put into a paper. The paper has very specific sizing instructions for figures that I'm having trouble matching in MATLAB. The figures need to be no greater than 3.5" width, >300 DPI, with 8pt font.
In my code, I use the following to try to set the parameters:
set(gcf,'PaperUnits','inches');
set(gcf,'PaperPosition',[0 0 3.5 3.5]);
xlabel('x-axis label','FontSize',8);ylabel('y-axis label','FontSize',8);
set(gca,'FontSize',8);
print('-djpeg','-r300','filename.jpg')
This should be giving me a 300 DPI, 3.5"x3.5" JPEG image with an 8pt font size. However, when I import the image into Word, it becomes 6.5" x 6.5" and the font size is larger than Word's 8pt font. Even if I resize the image, the font size is still too large, though it should maintain the same DPI. Are the FontSize and PaperPosition parameters not working as I expect they should or is Word doing something strange for importing?
The font size issue was caused due to differing fonts used in MATLAB and Word. Once I learned about set(gca,'FontName'), the font size seemed to be correct when the image was manually resized to 3.5" x 3.5".
The image size issue seemed to be related to saving it as a JPEG. Once I swapped to PNG, the image was the correct size by default. Looking into the JPEG properties, it had the correct number of pixels for a DPI of 300 at 3.5", the sole issue was that it would have to be manually resized. Thanks for the comments that led me to finding a solution.

How to set max height of a picture in crystal report?

Is it possible to set maximal height of a picture in crystal report and preserve original ratio of a picture?
If can grow is disabled, every picture is streched or shrinked to default picture object size, if is enabled, I'm losing limits of picture size.
I'm using crystal reports for VS 2013 (13.0.5)
Actually I solved this problem for Visual Basic 5.0 and Crystal Reports 6.0 (Seagate version). You asked the newer version but maybe this gives you an idea to solve the problem or it may help some other guys searching an answer for their problems.
Before you assign the report source you can change the height of the picture:
Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(269)
crxFieldObject.Height = theNewHeight
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
PS: After you assign the report source you can not change the height property. Below code does NOT work:
Private Sub Section3_Format(ByVal pFormattingInfo As Object)
Picture1.Height = theNewHeight 'this code does NOT work
End Sub
In this code:
.Sections.Item("D")means the Detail Section of the report and
.Item(269) means the Picture Object. After you insert an OLE Object you can check the item number with a small code such as:
aa = Report.Sections.Item("D").ReportObjects.Count
For i = 1 To aa
Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(i)
bb = crxFieldObject.Name
If Mid(bb, 1, 7) = "Picture" Then
crxFieldObject.suppress = False 'You can put a BreakPoint here to check the value of i
End If
Next i
Hope it helps
The answer is No. I did many tests and researches and I didn't found any way to control the height and, without controlling the height, it's not possible to fit an arbitrary image in the object box and keep is ratio at the same time.
Looks like it's and old problem.
But if all your images are limited to the same dimensions, like you have set your limits to 500x500, so you can have, for example, images that do 500x200, 500x500, 250x500, etc., there's a way to do it.
The object box needs to have the same ratio as your limits. In my example, 500x500, the ratio is 1:1 (square) so your object box needs to be square also. You need to check Can grow and, in the Image tab, set the size exactly like the object box's size. You also have to set the bitmap image size (right-click on the box, choose Bitmap Image Object then Modify) to the image limits (500x500).
Perhaps too late, but when you right click on picture -> shaping of the object
You've a checkbox "modular size", uncheck it and put manually the size you want on Image tab.

How can I size imageboxes to the image dimensions in Crystal Reports?

How can I size imageboxes to the image dimensions in Crystal Reports?
i am doing a project in tat i having 3 type of image with different size from db how can i set image
i found the answer here
To make the image resize properly, you must perform the following steps in order:
Set the image's EnableCanGrow to true
Calculate and set Width and Height to the needed size
Set the image's EnableCanGrow to false
Fill the DataSet's image object with data
Continue with normal report processing.
If you get these items in the wrong order, or skip an item, you will
find that Crystal Reports scales the image in unexpected and unrecoverable ways.
I had this issue. I managed to solve it by File > Report Options > Retain Original Image Color Depth. For some reason Crystal sees the altered background colour as part of the image so when you resize it it doesn't alter the background. By removing the background it gets you around this issue in some instances.