# \[ANN\] Makie.jl 0.19

**URL:** <https://discourse.julialang.org/t/ann-makie-jl-0-19/91184>\
**Category:** Package Announcements\
**Tags:** announcement, makie\
**Created:** [December 3, 2022, 5:20pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184 "2022-12-03T17:20:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 3, 2022, 5:20pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/1 "2022-12-03T17:20:50Z")

</div>

Makie.jl v0.19 is a small minor release containing only two relevant changes.

First, there’s a breaking change: All occurrences of `textsize` are now `fontsize`, so search and replace that word and you will be good to go. The reason is that both of these had been in use for a long time, so we had to pick a moment to clean that up, which is now.

The other change is a new feature. With rich text, you can more easily plot text with more than one font, color or fontsize, as well as superscripts and subscripts. This also fixes the issue with non-matching superscripts in log axes, because these are now small normal glyphs and not special superscript glyphs, which many fonts don’t have (and there aren’t any unicode options for many glyphs you’d want to superscript or subscript, anyway). So now log tick styles will work regardless of font coverage of superscript glyphs. This will also be handy if you want to write simple math expressions in a font other than Computer Modern which is the hardcoded default of MathTexEngine.jl.

Below are a couple examples of rich text. Happy plotting!

```julia
using CairoMakie

f = Figure(fontsize = 30)
Label(
    f[1, 1],
    rich(
        "H", subscript("2"), "O is the formula for ",
        rich("water", color = :cornflowerblue, font = :italic)
    )
)

str = "A BEAUTIFUL RAINBOW"
rainbow = cgrad(:rainbow, length(str), categorical = true)
fontsizes = 30 .+ 10 .* sin.(range(0, 3pi, length = length(str)))

rainbow_chars = map(enumerate(str)) do (i, c)
    rich("$c", color = rainbow[i], fontsize = fontsizes[i])
end

Label(f[2, 1], rich(rainbow_chars...), font = :bold)

f

```

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/e/0/e0aa3e806074f37cdb7495f301e15aeb91ea2c73.png)

```julia
using CairoMakie

f = Figure(fontsize = 30)
Label(
    f[1, 1],
    rich(
        "ITALIC",
        superscript("Regular without x offset", font = :regular),
        font = :italic
    )
)

Label(
    f[2, 1],
    rich(
        "ITALIC",
        superscript("Regular with x offset", font = :regular, offset = (0.15, 0)),
        font = :italic
    )
)

f

```

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/3/8/389e47462b129d4d53a32e65caa0b942509a6261.png)

Log ticks:

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/9/1/9158857aff6fe6609a1695cb1546b1b5faffd7a4.png)

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/7/5/75abc8a4d5a86d7130a481421af38aba4dc6d4ee.png)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 3, 2022, 7:32pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/2 "2022-12-03T19:32:47Z")

</div>

I forgot to mention the other kind-of-breaking change that is also text related! So far, one would often see

```julia
f = Figure(..., font = "Arial")

```

to make a figure where Axis decorations and other text used the font Arial instead of the default TeX Gyre Heros Makie.

But this hasn’t worked well anymore ever since axis titles were bold by default, because there was no way to also change all bold fonts. One would have to go to the attributes of Axis, Axis3, Legend, etc. directly.

Now, the way to go is:

```julia
f = Figure(..., fonts = (; regular = "Arial", bold = "Arial bold"))`

```

Notice it’s `fonts` instead of `font`.

Text with `font = :regular` will resolve to Arial, text with `font = :bold` will resolve to Arial Bold.  
This makes it easier to theme fonts across the figure.

Refer to this part of the docs for more info: [https://docs.makie.org/stable/documentation/fonts/index.html](https://docs.makie.org/stable/documentation/fonts/index.html)

---

<div class="post-metadata">

**Author:** ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)\
**Post date:** [December 4, 2022, 8:39am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/3 "2022-12-04T08:39:16Z")

</div>

Since we don’t have announcement posts for patch versions we should probably mention the important changes that happened between 0.18 - 0.19 too.

From my side there have been two GLMakie changes worth mentioning. The first is the removal of the stencil buffer in GLMakie, which has been limiting us to 255 scenes. Since blocks (Menu, Axis, etc) use at least one scene each, this also placed a limit on those, which reachable in more verbose dashboards.

The second is the introduction of `render_on_demand` as the new default rendering mode in GLMakie. With it rendering only happens when there is actually a visual change, rather than 30 times a second. If you’ve been annoyed by GLMakie draining your battery and/or putting your fans into overdrive, this is the change for you. And if you’ve been using it to heat your room, you can go back with `display(fig, render_on_demand=false)`.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 4, 2022, 8:45am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/4 "2022-12-04T08:45:01Z")

</div>

Good point, those were really good improvements!

---

<div class="post-metadata">

**Author:** ![Storopoli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/storopoli/32/209278_2.png) [@Storopoli](https://discourse.julialang.org/u/Storopoli)\
**Post date:** [December 5, 2022, 8:18am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/5 "2022-12-05T08:18:45Z")

</div>

Great release and announcement.

I still think that [Makie.org](http://Makie.org) should have a RSS feed.

> <https://github.com/MakieOrg/Website/issues/1>
>
> Some Julia packages Orgs have RSS feeds:
> 
> \- JuliaGPU
> \- Turing
> \- SciML
> 
> I d…on't know if MakieOrg ever thought on having a blog with a RSS feed.
> That would be great.

---

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [December 5, 2022, 10:00am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/6 "2022-12-05T10:00:58Z")

</div>

> [@ffreyer](#):
>
> The second is the introduction of `render_on_demand` as the new default rendering mode in GLMakie. With it rendering only happens when there is actually a visual change, rather than 30 times a second. If you’ve been annoyed by GLMakie draining your battery and/or putting your fans into overdrive, this is the change for you. And if you’ve been using it to heat your room, you can go back with `display(fig, render_on_demand=false)`.

Thank you for pointing that out. All my code has `GLMakie.set_window_config!(framerate=5.0)` because of the fan noise problem - can I leave that out from now on?

Thanks for all the great work!

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [December 5, 2022, 10:11am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/7 "2022-12-05T10:11:23Z")

</div>

Try it, but very likely yes 😉

---

<div class="post-metadata">

**Author:** ![tt1234567](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Post date:** [December 5, 2022, 10:45am UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/8 "2022-12-05T10:45:08Z")

</div>

Yes, it works well without having to reduce the frame rate. That’s a huge improvement - thanks again!

---

<div class="post-metadata">

**Author:** ![cmarcotte](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Post date:** [December 5, 2022, 12:51pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/9 "2022-12-05T12:51:15Z")

</div>

It appears the `Figure(font = texfont())` trick from MathTeXEngine no longer uses the correct tex font for the figure elements. Is this an intentional change?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 5, 2022, 1:14pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/10 "2022-12-05T13:14:59Z")

</div>

As described in my second post above, use `Figure(fonts = (; regular = texfont())`. The `Block`s all set `font = :regular` and `font = :bold` now and don’t inherit from the global `font` setting anymore.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [December 5, 2022, 6:59pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/11 "2022-12-05T18:59:32Z")

</div>

These are all great improvements! I like especially the textsize → fontsize one. Thanks!

---

<div class="post-metadata">

**Author:** ![sefffal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sefffal/32/23640_2.png) [@sefffal](https://discourse.julialang.org/u/sefffal)\
**Post date:** [December 26, 2022, 6:17pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/12 "2022-12-26T18:17:02Z")

</div>

Does Makie’s new rich text support work with LaTeX string too? E.g. is there a way to do `rich(L"a^2", color=:blue)`?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 26, 2022, 6:22pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/13 "2022-12-26T18:22:30Z")

</div>

No, currently those two types are separate.

---

<div class="post-metadata">

**Author:** ![sefffal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sefffal/32/23640_2.png) [@sefffal](https://discourse.julialang.org/u/sefffal)\
**Post date:** [December 26, 2022, 6:23pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/14 "2022-12-26T18:23:31Z")

</div>

> [@jules](#):
>
> No, currently those two types are separate.

Makes sense. Thanks!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 26, 2022, 6:39pm UTC](https://discourse.julialang.org/t/ann-makie-jl-0-19/91184/15 "2022-12-26T18:39:53Z")

</div>

In principle it could be made to work “easily” as in, both lower to the same glyph representations. But we’d have to adjust the layouting algorithms so they can deal with the mixtures in a way that makes sense. And I foresee that that could be not completely trivial
