# Makie: Fontsizes for Publications

**URL:** <https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721>\
**Category:** General Usage\
**Tags:** cairomakie\
**Created:** [August 1, 2024, 9:07am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721 "2024-08-01T09:07:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpirke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpirke/32/44837_2.png) [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Post date:** [August 1, 2024, 9:07am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721/1 "2024-08-01T09:07:21Z")

</div>

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)](https://docs.makie.org/stable/explanations/figure)

However if I do it like this it does not work for me.  
Here is what I do.

```julia
    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.

 ![Bildschirmfoto 2024-08-01 um 11.03.51](https://global.discourse-cdn.com/julialang/original/3X/5/8/58d80b39fe0d910e2d6f00cc88a487985fa14ea2.png)  
 ![Bildschirmfoto 2024-08-01 um 11.03.58](https://global.discourse-cdn.com/julialang/original/3X/0/f/0f0fcab9663bb5147dfae3980c3968cd87d159bd.png)

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!

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 1, 2024, 10:06am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721/2 "2024-08-01T10:06:36Z")

</div>

There is a second discussion going on here:

> [@How do you control the font size of a figure that is used in an academic publication?](https://discourse.julialang.org/t/how-do-you-control-the-font-size-of-a-figure-that-is-used-in-an-academic-publication/117713):
>
> 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.

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [August 1, 2024, 10:24am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721/3 "2024-08-01T10:24:59Z")

</div>

> [@mpirke](#):
>
> What am I missing or doing wrong?

Show you latex code please. I suspect you rescale the figure in there.

---

<div class="post-metadata">

**Author:** ![mpirke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpirke/32/44837_2.png) [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Post date:** [August 1, 2024, 10:36am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721/4 "2024-08-01T10:36:56Z")

</div>

Oh yeah did see that, thank you!

---

<div class="post-metadata">

**Author:** ![mpirke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpirke/32/44837_2.png) [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Post date:** [August 1, 2024, 10:37am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721/5 "2024-08-01T10:37:25Z")

</div>

Yeah, my mistake, i didnt see, i rescaled it in latex. My bad! Sorry for that!
