Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip certain bytes at the begining of a binary file in Gnuplot?

Tags:

plot

gnuplot

Say I have a binary file which has the following format: 4*sizeof(double), 4*sizeof(size_t), (Ny*Nx)*dizeof(double).

The first 4 doubles and the 4 size_ts are metainformation about the file. The rest is data I want to plot with gnuplot.

Right now I have to convert the file to another one without the header to plot using the command:

plot "convertedfile.data" binary format='%double' array=(Ny, Nx) u 1 w image

Q: Is there any way to tell gnuplot to ignore the starting N bytes of the binary file and then plot the rest as if its a matrix?

like image 811
Alejandro Cámara Avatar asked Nov 25 '25 18:11

Alejandro Cámara


1 Answers

You can skip some bytes at the beginning with skip

plot "convertedfile.data" binary skip=16 format='%double' array=(Ny, Nx) u 1 w image

will skip the first 16 bytes of the file.

like image 52
ABC Avatar answered Nov 28 '25 15:11

ABC