Beautiful Makie Gallery

just create a new folder env, and you install there just the things that you need.

https://pkgdocs.julialang.org/v1.2/environments/

something like this:

 lalonso@lap ~ % mkdir newenv
 lalonso@lap ~ % cd newenv
 lalonso@lap ~ % julia
] activate .
] add GLMakie CairoMakie Makie

Double axis would also not be hard to add, the LineAxis object is already an axis that you can place wherever (currently only horizontal or vertical though). So you could just place one next to an existing axis, but currently it’s a bit manual. I wanted to maybe make a layoutable out of it, so you can just place it in layout cells like other things.

@lazarusA , thanks.

Great work!

Inspired by this I installed GLMakie and started following the tutorial. I filed one minor issue about zooming too far spewing out a big error. But I also had a question I couldn’t find the answer to in the documentation, which is how to zoom back out? Is there a keyboard shortcut or a way to add a toolbar with a home button kind of like matplotlib?

I use the matplotlib gallery regularly, and find it super useful. This looks very similar, and the plots all look beautiful as the name suggests. I’d like a view where you can just scroll through and see all the plots rather than have to click down a menu to try to find the one I’m looking for. The home page is almost this, but it seems to just have one plot per section, rather than all plots from each section.

Also the “Dashboards” and “Test NDVI” examples dont work for me on chrome on windows.

1 Like

https://lazarusa.github.io/BeautifulMakie/surfWireLines/surfaceComplexF/
This plot might benefit from a cyclic colormap like romaO or phase

what is missing is the colorbar, so that you can see why I choose that colormap…
see for insntace this other example…

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

where is easy to see what is -pi and what is pi… roma could also work, phase not really.

yes, the homepage is suppose to be that, give it time.

  • Dashboards” and “Test NDVI” are still WIP, I do most of the heavy stuff during the weekends, so let’s hope to have that fixed soon, :smiley:
3 Likes

Ah, I was not sure if you want to show the jump as -pi and pi should be the same value.

This might also be interesting , but it is a bit off-topic.

5 Likes

The scatter with histogram is great. Is it possible to make the histogram as stacked histogram if the data has category data?

It is, one could do it manually, but at this point I think is better to use AlgebraOfGraphics (AoG) to do the grouping operations and then go back to regular Makie and put everything together. The following figure is compose from outputs from AoG and regular makie (density!, it seems like vertical and horizontal orientations don’t work in AoG, yet). Which is great!. Thanks to @piever for the tips. This stuff even works with 3d axis.

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

24 Likes

This is way beyond Ordinary Wizarding Levels, man!

6 Likes

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

This isn’t the same but I’d be surprised if you couldn’t produce your plot in Makie.jl:

Code (from April '20):

using ForwardDiff
using Makie # v0.10.0
using StatsMakie # v0.2.3

f(x,y) = -5*x*y*exp(-x^2-y^2)
x = -1:0.1:1.0
y = -1:0.1:1.0
z = [f(i,j) for i in x, j in y]

xy = [(i,j) for i in x for j in y]
# This is the same function as above, just modified so that it will work with ForwardDiff
g(x,y) = [-5*x*y*exp(-x^2-y^2)]
# Jacobians are scaled by 0.05 so that the vector arrows aren't too long when plotted
J = .05 .* [ForwardDiff.jacobian(x -> g(x[1], x[2]), [i[1],i[2]]) for i in xy]
# All the x coordinates
xs = [xy[i][1] for i in 1:length(xy)]
# All the y coordinates
ys = [xy[i][2] for i in 1:length(xy)]
# We need u,v for the quiver plot
u = [J[i][1] for i in 1:length(J)]
v = [J[i][2] for i in 1:length(J)]

scene = surface(x,y,z)
xm, ym, zm = minimum(scene_limits(scene))
contour!(scene, x, y, z, levels = 15, linewidth = 2, transformation = (:xy, zm))
arrows!(xs,ys,u,v, arrowsize=0.025, linewidth=0.5, transformation = (:xy, zm))
wireframe!(scene, x, y, z, overdraw = true, transparency = true, color = (:black, 0.1))
center!(scene) # center the Scene on the display

EDIT:

I had to cheat by increasing the z values to get the contour lines on top of the surface, hopefully there’s a better way to do that (because there’s a noticeable space :wink:). The code is mostly the same as above, just a few changes:

scene = surface(x,y,z)
xm, ym, zm = minimum(scene_limits(scene))
contour3d!(scene, x, y, z .+ 0.04, levels = 15, linewidth = 2, color=(:black, 0.5))
wireframe!(scene, x, y, z, overdraw = true, transparency = true, color = (:black, 0.1))
4 Likes

I will tweak a little bit this example and will put it into the gallery, ok?

Ok. This is getting out of hand :D, enough. Here, an updated version (I prefer a streamplot rather than arrows).

the code is here:
https://lazarusa.github.io/BeautifulMakie/withTheme/theme_dark_Contour3d/

20 Likes

Thank you. This is absolutely beautiful.

I am extremely curious that why you Makie users don’t adopt popular color themes such as Tableau-10 or ColorBrewer2 for discrete lines, and Viridis for colormaps. See Palettable for details. These three colors (orange, green, purple) are too saturated. Thus the bar plots are somewhat ugly. The shaded colors with alpha values, though, are more pleasant.

Afaik a Makie theme library doesn’t exist yet.

However, what I see is that most of Makie plots shown in discourse and Makie websites use that consistent color theme. May I say this is the de-facto color theme of Makie?

I mention the absence of Makie theme libraries not to disagree with your point, but to answer your question as to why Makie users (or at least one Makie user) don’t use ColorBrewer themes: if MakieThemes.jl were maintained and had ColorBrewer themes, I would be using them. The tool just isn’t available yet.

if your are referring to this plot, that is not a theme, and the choice of colours is due to this reference: palmerpenguins R data package • palmerpenguins nothing more(maybe putting some transparency will improve also the histograms, as in the R examples).

2 Likes

Makie’s default palette is from a nature paper about color choice in scientific publications, the default colormap is viridis, so I think there’s no problem there. Lazaro’s examples just exercise a lot of functionality for demonstration purposes I think, not necessarily to convince that purple and orange are the way to go generally.

You don’t need a theme library to set your colors to colorbrewer palettes, just set the cycle colors to a palette of your choice, they’re all there Colors · Makie Plotting Ecosystem

5 Likes