# Beautiful Makie Gallery

Not a package but a gallery of Beautiful Makie examples. Take a look, easy to copy and paste scripts to get you started with Makie. Beautiful Makie

https://lazarusa.github.io/BeautifulMakie/

Please free to comment and contribute with more examples via PRs. The examples could be simple or as complicated as you can imagine. The point is to show all the things you can do with Makie.

79 Likes

Awesome!

1 Like

Is it possible to get these into the Makie docs under the gallery so more folks can find them?

11 Likes

Is Makie the defacto Julia plotting library going forward? Currently I use Gnuplot (Gnuplots.jl) which I think makes beautiful plots, but is implemented as macros and not language integrated.

Yes definitely a good idea! PR would be welcome to add them to the first page of the docs!

4 Likes

I do both. I do Gnuplot.jl mainly due to the nice integration with LaTeX. Hopefully, makie will have also that in the near future.

4 Likes

Not yet at least. Currently, it’s one growing, promising player in an increasingly vibrant plotting ecosystem with many packages that each have strengths and weaknesses.

You may want to check out Gaston.jl if you want to use Gnuplot, but have more ‘julian’ syntax and such.

8 Likes

Yeah only time will tell what plot libraries people prefer. Makie has a lot of great features and also a lot to catch up on compared to older packages. But we’ve definitely noticed increasing interest and there are more and more people helping to improve

6 Likes

With AlgebraOfGraphics I see a lot of potential to become the new (and maintained) Gadfly. I‘m definitely going to try to replace my existing Gadly plots.

7 Likes

Yes AlgebraOfGraphics is really promising, especially nice that you can easily tweak the figures it produces after the fact, add other plots, modify legends and axes, etc

3 Likes

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…

12 Likes

Is there way to pass your data and mapping at the same time ? having to pack your data just to unpack them the next line isn’t ideal :

x = range(-π, π, length=100)
y = sin.(x)
df = (; x, y)
data(df) * mapping(:x, :y) * visual(Lines)


In Gadfly you would just do layer(x = x, y = y, Geom.line).

1 Like

Yeah it would be nice to have something like

df = (x=[1,2,3], y=[5,5,5])
mapped(df)


as equivalent to

df = (x=[1,2,3], y=[5,5,5])
data(df) * mapping(:x, :y)


Edit: I think a better way would be to have

mapdata([1,2,3], [5,5,5], color=["a", "a", "b"])


as equivalent to

df = (x=[1,2,3], y=[5,5,5], t=["a", "a", "b"])
data(df) * mapping(:x, :y, color=:t)

1 Like

As in the cairotex export? Or just using latex in plots in general?

Do you have examples? I don’t doubt you. I’m just always keen to know things that will make life easier!

yes as in cairolatex.

https://gcalderone.github.io/Gnuplot.jl/v1.4.0/terminals/#The-cairolatex-terminal

1 Like

Another brilliant thing I wasn’t aware of till today. Do you happen to know if there’s an obvious reason why plots need to be rasterisedduring the export process?

nope.

1 Like

You can also check my gallery with Gnuplot
,
https://lazarusa.github.io/gnuplot-examples/

4 Likes

Because it’s ridiculously hard to get text layouts out of latex, and the only feasible way, without reimplementing the layouting, is to export to svg and draw that - which requires a backend that knows how to draw svgs.
Makie is getting both ways integrated tightly soon with:
GitHub - JuliaPlots/MakieTeX.jl: TeX integration in Makie (svg route)
GitHub - Kolaru/MathTeXEngine.jl (own parsing + layouting, thanks to @Kolaru )

A little teaser from @jules, who started a deeper integration of MathTexEngine:

lines(cumsum(randn(1000)),
axis = (
title = L"x + y - sin(x) × tan(y) + \sqrt{2}",
xlabel = L"\lim_{x →\infty} A^j v_{(a + b)_k}^i \sqrt{2} x!= \sqrt{\frac{1+6}{4+a+g}}\int_{0}^{2π} \sin(x) dx",
ylabel = L"x + y - sin(x) × tan(y) + \sqrt{2}",
),
figure = (fontsize = 18, font = "NewCM10-Regular.otf")
)


29 Likes