Example of failure:
# # Imaginary component is lost when array element value # is referenced as $2 in a plot command # array A[4] = [ {0.,1.}, {1.,0.}, {0,-1.}, {-1.,0.} ] set xrange [-2:2] set yrange [-2:2] plot A using (real($2)):(imag($2)):(sprintf("%d"),$1) with labels
It does work if you instead say
plot sample [i=1:4:1] '+' using (real(A[i])):(imag(A[i]))
so this has something to do with the $ operator
gnuplot datafiles have never been capable of holding complex numbers, so it's no surprise that neither the $ operator nor the column() function can read complex numbers. I think this qualifies not as a bug, but as a feature request.
Last edit: Hans-Bernhard Broeker 2017-06-04
Yeah. But upon reflection I don't think it's necessary. There is a fairly clean alternative syntax that already works, though I didn't think of the first time around.
I'll make sure it's documented somewhere and used in a demo.