mpirke
August 1, 2024, 9:07am
1
Hey out there!
I want to use CairoMakie.jl for my figures in a scientific work. The fontsize of the figure should match the fontsize of the text (12).
I have found a reference on the Makie site discussion this issue. (here)
However if I do it like this it does not work for me.
Here is what I do.
using CairoMakie
set_theme!(theme_latexfonts(), fontsize=12)
width = 6 # in cm
height = 6
size = 28.3465 .* (width, height)
fig = Figure(size=size)
ax = Axis(fig[1, 1], xlabel="foo", ylabel="bar")
scatter!(rand(10), rand(10))
save("6x6.pdf", fig; pt_per_unit=1)
If I integrate the pdf in a latex document it looks like this.
As you can see the bigger one matches the fontsize of the latex document quite well, however the fontsize on the smaller one is way to big.
What am I missing or doing wrong?
Thanks for the help!
1 Like
oheil
August 1, 2024, 10:06am
2
There is a second discussion going on here:
Hi, everyone! I wonder how do you control the font size of a figure that is used in an academic publication, for example, if we plot the figure with Makie and write a paper with LaTex?
Usually, we can tune in Julia both the size of a figure and the font size in it, and in LaTex we can also tune the size of the inserted figure using e.g., \includegraphics[width=0.6\textwidth]{figure.pdf}. So there seems to be so much freedom here that it’s hard to control the exact size of the final font, so I h…
In case you missed it and they missed your request.
Show you latex code please. I suspect you rescale the figure in there.
mpirke
August 1, 2024, 10:36am
4
Oh yeah did see that, thank you!
mpirke
August 1, 2024, 10:37am
5
Yeah, my mistake, i didnt see, i rescaled it in latex. My bad! Sorry for that!