gnuplot.nim icon indicating copy to clipboard operation
gnuplot.nim copied to clipboard

data plot multiple line : enhancement proposal

Open HJarausch opened this issue 4 years ago • 0 comments

I like to propose an additional plot procedure for plotting multiple data lines

func quote(s:string) : string =
  '"' & s & '"'
....
proc plot*[X, Y](xs: openarray[X],
                 ys: seq[seq[Y]],
                 keys: seq[string]= @[""],
                 styles: seq[Style]= @[]) =

This plots multiple lines ys[i] versus xs. It produces something like

set title quote(keys[0])
plot "my.data" using 1:2 title quote(keys[1]) with toLowerAscii($styles[0]), "" using 1:3 title quote(keys[2]) 
with toLowerAscii($styles[1]) ...

The existing sendPlot had to be modified to include an additional last parameter multi:bool=false to skip some processing for plotting multiple lines

gnuplot.nim.patch.txt

HJarausch avatar Jan 26 '21 16:01 HJarausch