What is the correct way to use a for loop plotting within a lilaq diagram?

Hi @Christopher_Marcotte ,

you can achieve this with unpacking of arrays, like

#import "@preview/lilaq:0.2.0" as lq

#let x = lq.linspace(0, 10)
#lq.diagram(
  ..range(6).map(i => lq.plot(x, x.map(x => x + i)))
)

In your example, you would replace range(6) with your array A. Each element is mapped to a lq.plot instance which results in an array of plots.

With the .. unpacking syntax, you can pass the array items as individual arguments to lq.diagram.

3 Likes