2

For 1D plots, I know I can plot every nth point using:

plot "data" every 8 using 1:2

However I want to do the same for a 2D vector plot. Currently I am doing (e.g.):

plot "temp" every 8 using 1:2:5:6 with vector nohead

though this just plots every nth point in the y-direction, not for x and y. If not, is there a quick awk oneliner to fix the input file?

every 2 points every 4 points every 8 points

1
  • It could be as simple as using every 8:Y (Y being the block increment) if your data file is organized into blocks. Otherwise it might require reformatting your data file--I should point out that we can't really give you a quick awk one-liner without seeing how your data file is formatted. Commented Mar 4, 2014 at 19:02

1 Answer 1

2

I guess your data is formatted in blocks, i.e. different x-values are separated by an empty line:

x0 y0
x0 y1
x0 y2 
...
x0 yn

x1 y0
x1 y2
...

In that case, using every 8 only selects every eighth point in every block (those unit separated by empty lines). So you must also select every eighth block with every 8:8:

plot "temp" every 8:8 using 1:2:5:6 with vector nohead

That behavior doesn't depend on the plotting style, but only on the data file format.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect, exactly what I need. I had previously tried every 2,2 but that didn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.