# \[ANN\] MakieExtra.jl – more recipes and tools for Makie plots

**URL:** <https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618>\
**Category:** Package Announcements\
**Tags:** makie\
**Created:** [August 26, 2024, 10:48am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618 "2024-08-26T10:48:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 26, 2024, 10:48am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/1 "2024-08-26T10:48:53Z")

</div>

# [MakieExtra.jl](https://github.com/JuliaAPlavin/MakieExtra.jl) 🔮

Announcing a package I released recently, [MakieExtra.jl](https://github.com/JuliaAPlavin/MakieExtra.jl).  
It includes a bunch of new stuff for plotting that is either:

- can only be implemented with some “hacks” at the current state of `Makie`,
- or not fleshed out enough to be included into `Makie` itself,
- or may be considered too opinionated.

Still, I believe the features in `MakieExtra` are generally useful and worth packaging to make them readily available for use in both scripts and other packages.

See the [documentation](https://aplavin.github.io/MakieExtra.jl/test/examples.html) for a list of what’s available in `MakieExtra`.  
Below are a few highlights of visual functionality that I consider stable. There’s more – check out [docs with examples](https://aplavin.github.io/MakieExtra.jl/test/examples.html)!  
`MakieExtra` also has some less stable experimental functionality. I’ll probably add separate posts about it, asking for feedback.

Additionally, this is a **R** equest **F** or **C** ollaboration: if you have recipes/tweaks/utilities of reasonably-general use that are unlikely to get into `Makie`, feel free to contribute to [MakieExtra](https://github.com/JuliaAPlavin/MakieExtra.jl)!  
It’s intended to have a lower barrier for entry than `Makie` itself.

# Examples

### Automatic scalebar and zoom lines

  

### Lines with arrows at either end

### Glowing lines and text

### Markers with adjustable linewidth

### Symlog scale variants

### Figure from SkyImages.jl docs using several MakieExtra features

 ![download](https://global.discourse-cdn.com/julialang/original/3X/3/f/3f33ed1d14ac49a64fbb9630cbdadf43db0e4d38.jpeg)

---

<div class="post-metadata">

**Author:** ![briochemc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/briochemc/32/4209_2.png) [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Post date:** [August 27, 2024, 12:13am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/2 "2024-08-27T00:13:23Z")

</div>

You should showcase the axis tick locator and formatter too, it’s a very common customization request!

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 27, 2024, 1:00am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/3 "2024-08-27T01:00:58Z")

</div>

Thanks!  
I also like them and use `BaseMulTicks` & `EngTicks` quite often. Example plot from the docs:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/2/12d923abaae9a7e52c0a24909d79d7547a719fd5.png)  
It’s unexpectedly difficult to handle all edgecases btw, especially for the locator. Most of rough edges are already smoothed out during my own usage, but some may still remain.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 28, 2024, 11:34am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/4 "2024-08-28T11:34:45Z")

</div>

> [@aplavin](#):
>
> `MakieExtra` also has some less stable experimental functionality. I’ll probably add separate posts about it, asking for feedback.

Here’s the first post about more experimental features (:

Very often, I find myself plotting the exact same arguments with two or more recipes – either different recipes like `Lines + Band`, or the same recipe with different option.  
[MakieExtra.jl](https://github.com/JuliaAPlavin/MakieExtra.jl) provides simple `multiplot()` and `multiplot!()` functions to make this convenient. `multiplot()` passes its positional arguments to all requested recipes as-is, and can either pass the same or different kwargs/attributes to each recipe.

A few example from [the docs](https://aplavin.github.io/MakieExtra.jl/test/examples.html):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/7/a71c35d6d9cc7b2dd5e3f009e26bdb2e16d3c273.jpeg)

I’ve been using `multiplot()` recently, and found it quite convenient. It’s considered experimental for now mostly because I’m not sure whether the current interface is clean and understandable enough. The general concept of `multiplot` is definitely there to stay though (:  
Let me know if you have any thoughts on this!

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [August 28, 2024, 12:03pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/5 "2024-08-28T12:03:25Z")

</div>

Thanks, I definitely need the axis zoom functionality here.

cc @asinghvi17 and @lazarusA and “Daniel” (who?); in the Makie discord we were having a discussion about many disparate Makie-based projects popping up for themeing and convenience functions, like my [GitHub - Datseris/MakieForProjects.jl: Themeing and convenience tools for accelerating working with Makie.jl](https://github.com/Datseris/MakieForProjects.jl/) . The discussion ended with the common hope being that all these disparate projects become one. We haven’t however concluded on what is the best way to do this.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [August 28, 2024, 12:06pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/6 "2024-08-28T12:06:10Z")

</div>

As far as I am concenred, I am happy to put all functionality from MakieForProjects.jl to another project such as MakieExtras.jl. It appears similar in their type of convenience functionalities they provide, beyond the additional themeing I have, which I can add by itself to MakieThemeing.jl (provided that MakieThemeing.jl is improved in terms of modularity for its themeing; I find the possibility of themeing Axis color, background color, and color cycle all independently to be very nice for my work).

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 28, 2024, 12:41pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/7 "2024-08-28T12:41:31Z")

</div>

As discussed on Zulip, it would be even more useful if some of these recipes were shipped with Makie.jl itself instead of extra packages. Otherwise it becomes difficult to ensure long-term availability and automatic loading with package extensions.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 28, 2024, 1:23pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/8 "2024-08-28T13:23:00Z")

</div>

> [@juliohm](#):
>
> Otherwise it becomes difficult to ensure long-term availability and automatic loading with package extensions.

Re long-term availability: there’s no magic in including more stuff into Julia Base, Makie, or whatever, it doesn’t automatically make that stuff easier to maintain. Instead, it increases load on maintainers, and Makie is a large complex project already. Of course, if Makie devs want to upstream something from MakieExtra, they are always free to do so.

The extensions situation may improve at some point if [Dependencies of an Extension · Issue #3641 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/3641) and [Allow package extensions to have dependencies · Issue #52663 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/52663) get more support.  
For now, one has to make a weakdep on MakieExtra and ask users to load it if some of its features are needed for the package extension. Not too bad IMO, and shouldn’t happen too often: most of MakieExtra features are likely to be called by the enduser, not from packages.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 28, 2024, 1:28pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/9 "2024-08-28T13:28:07Z")

</div>

> [@Datseris](#):
>
> Makie-based projects popping up for themeing and convenience functions, like my [GitHub - Datseris/MakieForProjects.jl: Themeing and convenience tools for accelerating working with Makie.jl](https://github.com/Datseris/MakieForProjects.jl/)

Thanks for pointing this out, I haven’t seen your MakieForProjects!

I agree with you in that whenever possible those features should go into focused packages, like MakieThemeing. Or Colors for these functions: [MakieForProjects.jl/src/colormanip.jl at main · Datseris/MakieForProjects.jl · GitHub](https://github.com/Datseris/MakieForProjects.jl/blob/main/src/colormanip.jl).  
If there remain some Makie-specific functions that are of a general use, they could indeed be put into MakieExtra.jl.

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [August 28, 2024, 1:59pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/10 "2024-08-28T13:59:04Z")

</div>

I use `axesgrid` literally in every plot I do that is work-related. ([MakieForProjects · MakieForProjects.jl](https://datseris.github.io/MakieForProjects.jl/dev/#MakieForProjects.axesgrid)) . For the final figure of a paper I always have to use [MakieForProjects · MakieForProjects.jl](https://datseris.github.io/MakieForProjects.jl/dev/#MakieForProjects.label_axes)! .

In my view such functions are on the same level of functions like your axis zoomin. They aren’t opinionated, but are convenience tools.

Would be good if we can agree on where all such things should be. I think they should be in Makie directly. But another solution Im happy with. What I would prefer is that the final solution is in the Makie github org instead of an individual.

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [August 28, 2024, 2:46pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/11 "2024-08-28T14:46:22Z")

</div>

This is really neat! Love it.

---

<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:** [August 28, 2024, 8:39pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/12 "2024-08-28T20:39:08Z")

</div>

I think it’s easiest to include features into Base Makie that are relatively simple and can be composed well with others. A lot of convenience functions people build are somewhere above that, in the composition zone, and the problem is that this space is much larger than the basic component space.

Basically Makie gives you so many possibilities that it’s difficult to decide on “canonical” ones. So that’s why a function like `axesgrid` is a bit more difficult for me to integrate, it’s no doubt useful but there’s a ton of other ways to assemble axes into grids, so I ask what makes this specific one worth being integrated. If we find however that 90% of users always try to build the same thing manually, then it’d be worth using it to reduce that complexity.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 28, 2024, 9:00pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/13 "2024-08-28T21:00:05Z")

</div>

@jules what do you think of the `scalebar` recipe above? Would it be ok to port it to Makie.jl? Displaying the true scale of physical objects in 2D and 3D is really useful (e.g., 3D digital rock models, 2D maps).

---

<div class="post-metadata">

**Author:** ![DanielVandH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielvandh/32/31134_2.png) [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Post date:** [August 28, 2024, 9:34pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/14 "2024-08-28T21:34:07Z")

</div>

Another benefit of having things in a separate package is that it makes it easier to see how these features work / lets them evolve. It also makes it easier for the developer to work on the features instead of being stuck in a PR where it can take ages / demotivate the effort depending on how the PR goes (not that PRs taking time is bad thing, for a project like Makie it should definitely require more care / a higher barrier).

I think it is easier for those not doing the work/maintenace to suggest more work to do and go through that process, but I imagine for example it is easier for @aplavin to make this package and have the features they want in a registered package that is immediately available.

Maybe as the methods mature they could be incorporated into Makie directly but as @jules mentions in some cases it’s not obvious the best way forward anyway.

Anyway: Really nice package! The features are great.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 29, 2024, 1:26am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/15 "2024-08-29T01:26:15Z")

</div>

In case someone wants to try upstreaming features from MakieExtra to Makie proper, these are the primary candidates IMO:

- Lines with arrows, see [`linesegments` with arrow, or `arrows` method that takes a pair of points · Issue #2612 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/2612)
- Symlog scale, see [Symlog scale leads to weird results · Issue #3788 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/3788)
- Text glow, see [`text`: stroke and glow overwrites consecutive letters · Issue #2237 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/2237)
- Line glow/stroke, see [Add `strokecolor` and `strokewidth` attributes to `lines` · Issue #1597 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/1597)
- Adding `stroke` support to `band()`, currently `MakieExtra.bandstroke()`.

@Datseris, I understand that `axesgrid` turned out very useful for you, and it would be even more widely applicable if:

- some functionality was split into a separate function, for example “link axes + hide redundant labels” [`linkaxes!` should have `autohide` option · Issue #3807 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/3807)
- it could create a grid as a part of an existing figure as well

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [August 29, 2024, 7:23am UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/16 "2024-08-29T07:23:12Z")

</div>

Yeah it is super easy to modify the function to obtain a grid layout instead. This way it is arbitrarily applicable to a part of an existing figure.

CU!

George

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [October 23, 2024, 12:52pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/17 "2024-10-23T12:52:37Z")

</div>

# Highlights: new in MakieExtra

Docs with all the examples are available as [a Pluto notebook](https://juliaaplavin.github.io/MakieExtraDocs.jl/notebooks/examples.html).  
Some neat updates over the past months:

- `arrowlines` now support lines with any number of points, not just two. Basically, “like `lines`, but with arrowheads on one/both sides”:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/2/d2f06897d8ca0700bdd3c9bb89b6e16703b2a5b9.png)
- `zoom_lines` should be more reliable for transformed/reversed scales and for different relative positions of axes:  

- added `obsmap()` to easily compute the full trajectory of an observable, basically one line of code to turn the left plot into the right one:  

- and one more, major and relatively self-contained feature – will post separately soon 🙂

Minor new things that would be nice to just upstream if someone is up to putting some energy into the process:

- more convenient rich text manipulation:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/6/6692f226da2e020897fdb79b0c1b929793c5cffa.png)  
(should be easy to upstream, [define `*` for rich text concatenation · Issue #4393 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/4393))
- `changes(::Observable)` to only update downstream observables when the value actually changes, makes some animations much more efficient; [add changes() by aplavin · Pull Request #115 · JuliaGizmos/Observables.jl · GitHub](https://github.com/JuliaGizmos/Observables.jl/pull/115)
- small `show_gl_icon_in_dock(true/false)` function to hide the GLMakie icon from the MacOS dock — otherwise, with many open Julia instances/notebooks these icons cover a major part of the dock  
(upstream discussion: [Each Julia instance with loaded GLMakie results in a MacOS taskbar item · Issue #4278 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/4278))

---

<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:** [October 23, 2024, 2:35pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/18 "2024-10-23T14:35:55Z")

</div>

Regarding `changes`, there’s already the `ignore_equal_values=true` option for Observables, not sure if you knew about that.

---

<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:** [October 23, 2024, 2:43pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/19 "2024-10-23T14:43:52Z")

</div>

@aplavin the zoom lines are really neat! Looking forward to trying out this package.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [October 23, 2024, 3:05pm UTC](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618/20 "2024-10-23T15:05:50Z")

</div>

> [@jules](#):
>
> there’s already the `ignore_equal_values=true` option for Observables

I didn’t know indeed, thanks! This is a cleaner way to implement `changes()` under the hood, will switch in the next version.  
Still, as the user-facing interface, `changes(obs)` is typically cleaner anyway. For me, a common usage of `changes()` looks like

```julia
all_vals = [...]
x = Observable(0.)
xi = changes(@lift findfirst(>=($x), all_vals))
... use x and xi ...

Record(...) do x_
    x[] = x_
end

```

which doesn’t have an explicit `Observable()` call for `xi` where one could put `ignore_equal_values=true`.

[Next page](https://discourse.julialang.org/t/ann-makieextra-jl-more-recipes-and-tools-for-makie-plots/118618.md?page=2)
