Why does the 'set table' option in Gnuplot re-write the first entry in the last line?

前端 未结 1 1195
温柔的废话
温柔的废话 2021-01-24 21:03

I am trying to create a histogram from some data I have and just to get an idea of the frequencies and bins etc I set a table so that instead of plotting it it put the informati

1条回答
  •  难免孤独
    2021-01-24 21:43

    This behaviour is a gnuplot bug. To circumvent this bug, you can pipe your table output through head before writing to the output file:

    set output "| head -n -2 > tableavalanchesizeGSA"
    set table
    bw = 50.0
    bin(x,s)=s*int(x/s)
    plot 'avalanche_size_GSA.dat' using (bin($1,bw)+bw/2.0):(1.0/2048000) smooth frequency with points
    unset table
    

    You must skip the last two lines, because gnuplot writes an empty line at the end. Also you must use set output explicitely, piping seems not to work when setting the output with set table "| head ...".

    0 讨论(0)
提交回复
热议问题