Hello,
I really love Makie for all the nice decisions it takes automatically such as great color palettes. That being said, I can’t follow the layout tutorial because Makielayout doesn’t compile, I have been waiting for 2 hours, which I assumed is a sign of an issue.
I am not interested in making ultra complex subplots, I just want plot A next to plot B. There must be a “pure” Julian trick to do that, right?
R has a package called patchwork where you can literally codes “fig1 + fig2” to get the two next to each other. What’s the most convenient approach? In the worse case, I could pass my Julia objects to R so it makes the panel for me, right?
Sorry, can you explain the code magic behind this black sorcery?
How does Julia understand? I get with f = Figure() we make an object that will hold the graphs, rights?
But then, when you actually plot, how does it know how to arrange them?
And also,I don’t see you needing to call “f” at the end.
What does MakieLayout have to do with this? The example I linked to in the docs is
using CairoMakie
x = LinRange(0, 10, 100)
y = sin.(x)
fig = Figure()
lines(fig[1, 1], x, y, color = :red)
lines(fig[1, 2], x, y, color = :blue)
lines(fig[2, 1:2], x, y, color = :green)
fig
I feel like we’ve had a similar discussion a few days ago - do you have anything else imported which exports Figure? I’ve just copy/pasted the example from the docs which I posted above and it runs without error.
You should not install MakieLayout or AbstractPlotting. Those were part of Makie years ago but will only get you ancient versions or compilation errors now. Any tutorial you see using those is outdated. Check if you’re on the actual docs page docs.makie.org or on the juliahub package docs copy of an old version. Those tend to get ranked high on Google for some reason.
Thanks! So I need to get rid of all traces of those packages from my system, right?
Thanks again. It’s annoying those packages keep popping up. Maybe the devs should put an “warning outdated tutorials” on the Makie website? I know it’s probably low on their priority list, though.
I think the last version of AbstractPlotting actually has such a warning. We don’t control the juliahub copies though.
Yeah delete everything but Makie, CairoMakie, GLMakie or WGLMakie from your environment and then update it and you should be good to go. You don’t need to go hunting for file traces or anything, the environment entry is what matters. You can always find the latest versions in the footnote of the docs, so you can compare with those what you have. st in the package repl gives you that info
EDIT: it works in the REPL, not in visual studio, so maybe visual studio keeps stuff. What do you guys use? I am mainly doing plots, exploring data, not much programming per se. Thanks
It’s possible that you have VSCode pointed to an old version of Julia with a different package environment. That said, it’s recommended to keep separate package environments for each project so you don’t end up with dependencies tangled like this. You can make sure you’re in a project-specific environment by doing this at the top of your notebook:
using Pkg
Pkg.activate("~/path/to/your/project/")
Pkg.status()
and you should see the list of packages you’re trying to use. If they don’t show up, you can do
to add them to that specific environment. If you navigate to your project directory (~/path/to/your/project/), you’ll see a file called Project.toml that tells Julia which packages you’re asking for. If you switch versions of Julia, you can reinstall those packages by doing
using Pkg
Pkg.activate("~/path/to/your/project/")
Pkg.instantiate()