Starting the element count (x-axis) at 0 even when plotting data not at the start of file

Dario Sanfilippo <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <CALWGsHgw0Hvqr9SwGVphkCS4qV6-mMxCESNw_0QKg7YHh82MbQ@mail.gmail.com>
Hello, list.

I have a large .csv file and I need to plot only 500 of its elements which
are towards the end.

I would still like to have the x-axis to count the elements starting from 0.

I have the following script which generates this error: "all points y value
undefined!". It must be a problem with the operation that I perform on $0
because I can plot if I remove the subtraction.

Would you please help me understand what I'm doing wrong and, generally,
what is the best practice to start counting the elements from zero even
when the elements do not start from the zero-position?

Thanks,
Dario

low = 7005000

len = 500

set datafile separator ","

set key autotitle columnhead

set term postscript eps color font "Times-Roman,12"

set output 'zc.eps'

set key opaque

set y2range[0:1]

set xlabel "Samples"

set ylabel "Amplitude"

set grid lt 0 lc rgb "black" lw 2

set border lw .1

plot[low:(low+len)] ARG1 using ($0-low):2 with points ls 1 lc rgb "blue" lw
1 title "Looped drum sample", "" using ($0-low):3 with impulses lt rgb "red"
lw 1 axis x1y2 title "Trigger function"

reset

_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.