Multiple plots: some refinements

Is it possible to set Computer Modern as the legend font, to keep the fonts consistent?

Can you try ]up so that you get GridLayoutBase.jl v.0.5.7? It should work now:

f = Figure(font = "NewCM10-Regular.otf")
ls = []
for i in 1:4
    for j in 1:i
        ax = Axis(f[i, j], width = 100, height = 100, ylabel = "y label")
        push!(ls, lines!(ax, 0..10, sin, color = rand(RGBf0)))
        if i == j && j > 1
            ax.yaxisposition = :right
            if j < 4
                ax.alignmode = Mixed(right = MakieLayout.Protrusion(0))
            end
        elseif j > 1
            hideydecorations!(ax, grid = false)
        end
        if i < 4
            hidexdecorations!(ax, grid = false)
        end
    end
end
Legend(f[1, 4], ls, string.(1:10), halign = :right, valign = :top,
    tellwidth = false, nbanks = 3)
resize!(f.scene, f.layout.layoutobservables.reportedsize[]...)
save("test.pdf", f)

@lmiq as you can see, you can use a computer-modern like font for everything (for some reason in this case it only worked when giving the full path, though)

3 Likes

And…here we are!


The subplots size is exactly the one I wanted. The subplots are near, as I wanted. I have used LaTeX almost everywhere. This is great!
Now I need to write the code a bit better before posting, @liuyxpp . Furthermore, I have to understand why I cannot set NewCM10-Regular.otf as the legend font, but this is probably an issue related to my self. Thank you again @jules !

1 Like

Yeah you have to have the font file that I used of course :wink: Just wanted to show there’s no magic to it

1 Like

It was easy, in the end…and here the final result!


Hopefully tomorrow I’ll write the code in a better way, such that I can post it @liuyxpp :wink:

4 Likes

So, after some time (I had a couple of things to do) I managed to write (almost) what I wanted.
Here is the result


I am quite satisfied. I have divided the process in two steps:

  1. First, I create the structure with all the the square boxes, with the limits, ticks, and labels I want. These boxes are empty, they do not contain enything
  2. Then I draw the Fisher contours I want.
    This is quite useful, for several reason. The first step is the longest one, and I am wondering if I can create a deepcopy of the figure, to create a “white canvas” to be used repeatedly.
    However, when I make a deepcopy of the Figure, I receive a error message.

deepcopy of Modules not supported

Do you have any suggestion? If you want, I can share the code if useful. Let me know.
Thank you,
Marco

2 Likes