# Beautiful Makie Gallery

**URL:** <https://discourse.julialang.org/t/beautiful-makie-gallery/62523>\
**Category:** Package Announcements\
**Created:** [June 7, 2021, 2:29pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523 "2021-06-07T14:29:56Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [June 7, 2021, 11:10pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/21 "2021-06-07T23:10:00Z")

</div>

This is truly fantastic. Thanks for all the hard work going into makie.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [June 8, 2021, 7:13pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/22 "2021-06-08T19:13:50Z")

</div>

The syntax `mapping(x, y) * visual(Lines)` passing vectors directly is already taken for [pre-grouped data](http://juliaplots.org/AlgebraOfGraphics.jl/dev/generated/gallery/#Pre-grouped-data), but maybe it is more natural to use it for the usecase you are suggesting. Pre-grouped data should have to be signaled explicitly by the user (as was the case in a previous version). This will require a little bit of thought, but it’s an interesting point to consider.

PS sorry for hijacking the thread on Beautiful Makie with this side discussion

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [June 8, 2021, 10:52pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/23 "2021-06-08T22:52:45Z")

</div>

> At this point, there is almost nothing that I need that Makie can’t do. There are a few things that aren’t as convenient as in, say, ggplot, but the number of things (especially w/r/t figure generation) that are either much harder or impossible to do in other libraries is staggering. I cannot imagine going back…

Here is something, I think Makie still cannot do. Here is a challenge for anyone to reproduce this kind of graphics in Makie

![Screen Shot 2021-06-09 at 8.49.39 AM](https://global.discourse-cdn.com/julialang/original/3X/f/6/f612bd914072f698d46d941d015cedd2a9cedd35.png)

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 9, 2021, 12:05am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/24 "2021-06-09T00:05:22Z")

</div>

Yeah, fair enough - I don’t do any 3D plotting, so can’t comment on that front.

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [June 9, 2021, 12:49am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/25 "2021-06-09T00:49:33Z")

</div>

That seems similar to surface + contour3d. Same as [http://juliaplots.org/MakieReferenceImages/gallery//surface\_\_\_contour3d/index.html](http://juliaplots.org/MakieReferenceImages/gallery//surface___contour3d/index.html) but with the plots overlaid on top of each other with contour lines colored black?

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [June 9, 2021, 4:59am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/26 "2021-06-09T04:59:33Z")

</div>

a very similar version is here [with a lot more options to customise],  
[https://lazarusa.github.io/BeautifulMakie/surfWireLines/surfWireContour/](https://lazarusa.github.io/BeautifulMakie/surfWireLines/surfWireContour/)

 ![surfWireContour](https://global.discourse-cdn.com/julialang/original/3X/8/e/8e960fb82bd62d74bb6135b1c84af53548ec06e7.jpeg)

the black contour 3d lines will be easy to put on top.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [June 9, 2021, 7:38am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/27 "2021-06-09T07:38:24Z")

</div>

Some common things I didn’t find in the gallery :

- Scatter with an histogram/density on the side
- Double axis
- Insets

Is it possible to do those ?

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [June 9, 2021, 7:39am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/28 "2021-06-09T07:39:15Z")

</div>

> [@jonathanBieler](#):
>
> - Insets

[https://lazarusa.github.io/BeautifulMakie/ScattersLines/LineWithInset/](https://lazarusa.github.io/BeautifulMakie/ScattersLines/LineWithInset/)

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [June 9, 2021, 8:07am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/29 "2021-06-09T08:07:45Z")

</div>

I usually find double-axis plots confusing because they break the one-to-one correspondence between data space and figure space. Though they can be handy for expressing two linearly related units like cm and inches.

---

<div class="post-metadata">

**Author:** ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Post date:** [June 9, 2021, 8:27am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/30 "2021-06-09T08:27:59Z")

</div>

Can parallel coordinates plots be done using Makie?  
They still keep the one-to-one correspondence in higher dimensional data and are very useful to show parameter limits.

> **[Parallel](https://plotly.com/python/parallel-coordinates-plot/)**
>
> Detailed examples of Parallel Coordinates Plot including changing color, size, log axes, and more in Python.

---

<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:** [June 9, 2021, 8:54am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/31 "2021-06-09T08:54:49Z")

</div>

@jonathanBieler

> - Scatter with an histogram/density on the side

```julia
using CairoMakie
using StatsBase

##
set_theme!()
fig = Figure(resolution = (600, 600))

data = randn(200, 2) * [1 2; 2 1]

mainax = Axis(fig[2, 2])
hidedecorations!(mainax, grid=false)
hidespines!(mainax)
topax = Axis(fig[1, 2])
hidexdecorations!(topax, grid=false)
hideydecorations!(topax)
rightax = Axis(fig[2, 3])
hideydecorations!(rightax, grid=false)
hidexdecorations!(rightax)

bottomax = Axis(fig[3, 2], yticks=[0.0, 0.25])
hideydecorations!(bottomax)
bottomax.yreversed = true
leftax = Axis(fig[2, 1], xticks=[0.0, 0.25])
hidexdecorations!(leftax, grid=false)
leftax.xreversed = true

colsize!(fig.layout, 2, Relative(0.8))
rowsize!(fig.layout, 2, Relative(0.8))
colgap!(fig.layout, 0)
rowgap!(fig.layout, 0)

scatter!(mainax, data)
hist!(topax, data[:, 1])
hist!(rightax, data[:, 2], direction = :x)

density!(bottomax, data[:, 1])
density!(leftax, data[:, 2], direction = :y)

linkxaxes!(mainax, topax)
linkxaxes!(mainax, bottomax)
linkyaxes!(mainax, rightax)
linkyaxes!(mainax, leftax)

fig

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/b/bb9f5307a8bff8181e3e756b48d0a32f02d17295.png)  
Arbitrarily stylable of course 😉

@feanor12 It’s just a lineplot, so why not?  
The main work will be to style the axis, but I don’t see anything in there, that doesn’t look like it’s possible with all the axis customizations:  
[https://makie.juliaplots.org/stable/makielayout/axis.html](https://makie.juliaplots.org/stable/makielayout/axis.html)

---

<div class="post-metadata">

**Author:** ![feanor12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feanor12/32/8212_2.png) [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Post date:** [June 9, 2021, 9:28am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/32 "2021-06-09T09:28:04Z")

</div>

I did not see an option to place the axis inside the plot.  
Maybe it is possible by putting multiple line plots adjacent to each other with no gap?  
What option did you have in mind?

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [June 9, 2021, 9:57am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/33 "2021-06-09T09:57:59Z")

</div>

- Scatter with an histogram/density on the side  
ok. here a smaller version, compared to @sdanisch  
[https://lazarusa.github.io/BeautifulMakie/ScattersLines/ScatterHistDensitySides/](https://lazarusa.github.io/BeautifulMakie/ScattersLines/ScatterHistDensitySides/)  
and here a twin axis  
[https://lazarusa.github.io/BeautifulMakie/ScattersLines/twinAxis/](https://lazarusa.github.io/BeautifulMakie/ScattersLines/twinAxis/)

---

<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:** [June 9, 2021, 10:10am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/34 "2021-06-09T10:10:12Z")

</div>

This is a basic way you could do that in makie, of course with a bit of work that could be a nicely packaged up plot command:

```julia
using CairoMakie
CairoMakie.activate!(type = "svg")

let
    s = Scene(camera = campixel!)

    n = 5
    k = 20

    data = [randn(k) .* (rand() + 1) * 10 for _ in 1:n]

    limits = extrema.(data)

    scaled = [(d .- mi) ./ (ma - mi) for (d, (mi, ma)) in zip(data, limits)]

    width = 600
    height = 400
    offset = 100

    for i in 1:n
        x = (i - 1) / (n - 1) * width
        MakieLayout.LineAxis(s, limits = limits[i],
            spinecolor = :black, labelfont = "Arial",
            ticklabelfont = "Arial", spinevisible = true,
            minorticks = IntervalsBetween(2),
            endpoints = Point2f0[(offset + x, offset), (offset + x, offset + height)],
            ticklabelalign = (:right, :center), labelvisible = false)
    end

    for i in 1:k
        values = map(1:n, data, limits) do j, d, l
            x = (j - 1) / (n - 1) * width
            Point2f0(offset + x, (d[i] - l[1]) ./ (l[2] - l[1]) * height + offset)
        end

        lines!(s, values, color = get(Makie.ColorSchemes.inferno, (i - 1) / (k - 1)),
            show_axis = false)
    end

    s
end

```

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

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [June 9, 2021, 11:25am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/35 "2021-06-09T11:25:01Z")

</div>

Hi @lazarusA. Fantastic work, putting all these plots together. I am a newbie to Makie. Usually, I have used Plots, PGFPlotsX, and PlotlyJS, depending on the job. I tried some of your examples (by directly copying your code), and many of them don’t work. What does it mean to get the following error:  
`ERROR: LoadError: UndefVarError: Axis not defined`  
The same type of error appears with 3D plotting  
`ERROR: LoadError: UndefVarError: Axis3 not defined`  
Thanks.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [June 9, 2021, 11:35am UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/36 "2021-06-09T11:35:10Z")

</div>

Looks great thanks. I mean the code is a bit long, but it should be easy enough to write a helper function so it’s not a problem.

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [June 9, 2021, 12:27pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/37 "2021-06-09T12:27:37Z")

</div>

most probably is that you don’t have the proper dependencies. All examples have at the end the versions needed to reproduce the examples. Something like:

```julia
Status `~/Documents/BeaufitulMakie/Project.toml`
  [e9467ef8] GLMakie v0.3.2

```

---

<div class="post-metadata">

**Author:** ![lazarusA](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lazarusa/32/6571_2.png) [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Post date:** [June 9, 2021, 12:30pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/38 "2021-06-09T12:30:02Z")

</div>

Yeah, I know. The point is to be as pedagogical as possible, to see what you are actually doing and to be able to customise the plot as you wish afterwards if necessary. Probably a lot of examples could have been done in fewer lines, but IMO here you can see each step more or less clear.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [June 9, 2021, 2:32pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/39 "2021-06-09T14:32:46Z")

</div>

@jzr, double axes can be essential, in particular for non-linear monotonic relations, as in this [PyPlot example](https://discourse.julialang.org/t/plots-with-a-secondary-non-linear-axis-scale/56661).

---

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [June 9, 2021, 3:37pm UTC](https://discourse.julialang.org/t/beautiful-makie-gallery/62523/40 "2021-06-09T15:37:50Z")

</div>

@lazarusA , yes it appears that I have a problem with the Makie dependencies. I `up` GLMakie, CairoMakie and Makie. The last two were up updated to Makie v0.13.12, CairoMakie to 0.5.7 but GLMakie gets stuck in v0.1.30. I tried to force the installation of GLMakie v0.3.4, but, apparently, there is a conflict with WebIO and PLotlyJS. Is there a way to turn around this problem? Thank you.

```julia
@v1.6) pkg> add https://github.com/JuliaPlots/GLMakie.jl
     Cloning git-repo `https://github.com/JuliaPlots/GLMakie.jl`
    Updating git-repo `https://github.com/JuliaPlots/GLMakie.jl`
    Updating registry at `C:\Users\Utilizador\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
    Updating registry at `C:\Users\Utilizador\.julia\registries\JuliaPOMDP`
    Updating git-repo `https://github.com/JuliaPOMDP/Registry`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package WebIO [0f1e0344]:
 WebIO [0f1e0344] log:
 ├─possible versions are: 0.2.5-0.8.15 or uninstalled
 ├─restricted to versions 0.8 by PlotlyJS [f0f68f2c], leaving only versions 0.8.0-0.8.15
 │ └─PlotlyJS [f0f68f2c] log:
 │ ├─possible versions are: 0.14.1 or uninstalled
 │ ├─restricted to versions * by CryptoDashApp [8f55a569], leaving only versions 0.14.1
 │ │ └─CryptoDashApp [8f55a569] log:
 │ │ ├─possible versions are: 0.1.0 or uninstalled
 │ │ └─CryptoDashApp [8f55a569] is fixed to version 0.1.0
 │ └─PlotlyJS [f0f68f2c] is fixed to version 0.14.1
 ├─restricted by compatibility requirements with Blink [ad839575] to versions: [0.8.0-0.8.5, 0.8.7-0.8.15]
 │ └─Blink [ad839575] log:
 │ ├─possible versions are: 0.8.0-0.12.5 or uninstalled
 │ └─restricted to versions 0.12 by PlotlyJS [f0f68f2c], leaving only versions 0.12.0-0.12.5
 │ └─PlotlyJS [f0f68f2c] log: see above
 ├─restricted by compatibility requirements with Requires [ae029012] to versions: 0.8.3-0.8.15 or uninstalled, leaving only versions: [0.8.3-0.8.5, 0.8.7-0.8.15]
 │ └─Requires [ae029012] log:
 │ ├─possible versions are: 0.5.0-1.1.3 or uninstalled
 │ └─restricted to versions 1 by PlotlyJS [f0f68f2c], leaving only versions 1.0.0-1.1.3
 │ └─PlotlyJS [f0f68f2c] log: see above
 └─restricted by compatibility requirements with Observables [510215fc] to versions: uninstalled — no versions left
   └─Observables [510215fc] log:
     ├─possible versions are: 0.2.0-0.4.0 or uninstalled
     └─restricted to versions 0.4 by GLMakie [e9467ef8], leaving only versions 0.4.0   
       └─GLMakie [e9467ef8] log:
         ├─possible versions are: 0.3.4 or uninstalled
         └─GLMakie [e9467ef8] is fixed to version 0.3.4

```

[Previous page](https://discourse.julialang.org/t/beautiful-makie-gallery/62523.md?page=1)

[Next page](https://discourse.julialang.org/t/beautiful-makie-gallery/62523.md?page=3)
