How do you specify the paper size of the PDF image? Alternatively, how do you control the physical size of the axes? I must be fundamentally misunderstanding how the sizing of the plot works.
In the example at the end of this massage, I specify size both for Figure() and save() to be 100 × 80 mm but the paper size (MediaBox) of the resultant PDF is 211.7 × 158.7 mm, which is 600 × 450 pt. (You can view this information in the “Properties” menu of Adobe Reader, or by clicking on the “i” button on Preview. The PDF file also includes the statement /MediaBox [ 0 0 600 450 ].)
[Edit: It turns out that the version of Makie I was using didn’t support size, which was the primary reason why the paper size didn’t change. See below for details.]
As a result, the text is too small and lines are too thin.
[I’m not asking how to change font size and line width. Rather, changing the physical size of the plots is much easier to make them suitable to be included in a PDF document. Because the main text would be 10 to 12pt, the letterings in the figure should be 9pt or 10pt. The default line width would be probably fine if the figure is 100 × 80 mm . . . ]
No! How do you find it? What keyword do you use to arrive at the page?
I feel really stupid with Makie. Somehow I’m unable to locate relevant documents!!!
I of course went to https://docs.makie.org/ and looked at various pages. I of course searched google. I of course searched this forum. I think I’m normally very good at finding relevant technical information . . .
Btw one tip for Makie, I often use GitHub’s code search to search the repository. It often finds the docs faster than through website. It’ll also find issues and such which can be helpful.
I carefully read and re-read the explanation of pt_per_unit and I thought I understood this part:
A Figure with size = (600, 450) will be 600 x 450 points in size when exported with pt_per_unit = 1 , 300 x 225 with pt_per_unit = 0.5 and 1200 x 900 with pt_per_unit = 2 .
So, a figure with size = (300,255) with pt_per_unit = 1 will produce a page 300 × 450 pt.
But the following code still produces a page of 800 × 600 pt . . .
I often use GitHub’s code search to search the repository.
I tried that feature sometime ago, but the search seemed to search for filenames. Your words seem to indicate that you can search the contents of the files.
Are you on 0.20? You getting a 800x600 figure indicates that the new size keyword is ignored and the default is still the old one, so you’re probably on 0.19
@jules Are you the second author of this paper, https://joss.theoj.org/papers/10.21105/joss.03349 ? In the manuscript I’m writing now, I plan to mention you in the “acknowledgements” section for answering so many (often stupid) questions from me, as well as citing the paper. (I tried to find a way to private-message you but didn’t find it.)
was totally wrong. I’m now on a different Mac machine and had exactly the same problem.
I then learned why a package which “may be upgradable” (as reported by Pkg.status) is not upgraded unless you force it by specifying the desired version number.
In my particular case, CairoMakie and NCDatasets weren’t upgraded. When I forced them to be their latest versions, a lot of other packages were downgraded. But, after removing Rasters, all potentially “upgradable” packages were upgraded. So, it seems (although I’m not 100% sure) that that was because Rasters depends on older versions of some packages on which Makie depends.