Copying the code from the examples here
I have tried to add a label to the inner plot like:
#import "@preview/lilaq:0.6.0" as lq
#let weierstrass(x, k: 8) = {
range(k).map(k => calc.pow(0.5, k) * calc.cos(calc.pow(5, k) * x)).sum()
}
#let xs = lq.linspace(-0.5, .5, num: 1000)
#let xs-fine = lq.linspace(-0.05, 0, num: 1000)
#show: lq.set-grid(stroke: none)
#lq.diagram(
width: 14cm,
height: 7cm,
ylim: (0, 2),
margin: (x: 2%),
lq.plot(xs, weierstrass, mark: none),
lq.rect(-0.05, 1.5, width: .05, height: .3),
lq.place(
60%, 100% - 1.2em,
align: bottom,
lq.diagram(
width: 5.4cm, height: 2cm,
margin: 0%,
ylim: (1.5, 1.8),
fill: white,
lq.plot(
xs-fine,
weierstrass,
mark: none,
label: [Inner],
),
)
)
)
It fails with the error:
error: expected function, found alignment
┌─ @preview/lilaq:0.6.0/src/style/styling.typ:32:4
│
32 │ (it.align)((
│ ^^^^^^^^^^
help: error occurred while applying show rule to this grid
┌─ @preview/lilaq:0.6.0/src/model/legend.typ:88:4
│
88 │ grid(..it.children)
│
I have also tried to put it manually with lq.legend in the inner plot, but it gives the same error.
I guess it is possible to “fake” it in the outer plot, and move it by hand. In this case:
- How do I make it appear on top of the inner plot? I played with the z-index, but it never shows up.
- How do I make the figure of “dashed”, “dotted”, “solid” and “marker with error bars” appear in the legends by hand?