glot
glot copied to clipboard
Consider plotXY writing binary file format
Consider changing Plot.plotXY to write a binary file, for faster execution and less IO in both the go code and gnuplot code.
This is a consideration when plotting millions or tens of millions of points. Most other plotting packages can't handle that size. For term png or gif, 20M points takes about 5 seconds.
Here is an example of a gnuplot command for reading a binary file with an array of struct { x, y float32 }: plot '/tmp/gnuplotdata.bin' binary format='%float32%float32' using 1:2
Here is a gist for writing a binary file, using memory mapped IO. It takes about 200 ms for 20M points. https://gist.github.com/ericjster/eea32820660e26b16174fadd4034dd9d