'How to title a gnuplot line based on offset array index in bash script?

I have an array of names and a csv file:

  name=(abc def ghi jkl)    |     1, 2, 3, 4, 5
                            |     6, 7, 8, 9, 10
  

I want to plot the csv file by col1 against every other col(2..5), then title each line with the array. So the index of the column and the array to plot are not the same; offset. For instance:

 gnuplot < plot 'input.csv' using 1:2 t "${name[0]}" 

I've tried using the word() of gnuplot, and tried for (name, -1), (name, 1) as well:

 gnuplot < plot 'input.csv' using 1:2 t word(name, 0)

But I always receive the following error:

 line 0: internal error : non-STRING argument

I'm certain my array is space-separated, complying with word(). I don't know why it's not recognizing the names. Please and thank you for any suggestions to resolve...



Solution 1:[1]

I was trying to doit the hard way, here's the simple and elegant solution

const ImageGrid = ({slice} :any) => {
  const pack :any = []
  
  slice?.items?.map((item :any, i:number) => {
    pack.push(<Child data={item}/>)
  })
  
  const data2 = [...pack]
  const groupedData1 = []
  
  while(data2.length) {
    groupedData1.push(data2.splice(0, 3));
  }

  return (
    <>
      <Container maxW={1180} bg='orange'>
        <GridWrap>
          {groupedData1.map((el, i) => 
            <Parent>
              <HStack alignItems={'top'}> {el} </HStack>
            </Parent>
          )}
        </GridWrap>
      </Container>
    </>
  )
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1