Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Suppose I have a data file divided into blocks as follws
0 0 1 2 2 0 0 5 1 3 2 4 0 -1 1 3 2 5 ...
Is there any way to tell gnuplot to plot only the last block?
index
To access an arbitrary block you can use index. Unfortunately, you cannot access "the last block" without knowing its index. So you must use stats to get the number of blocks:
stats
stats 'file.dat' using 1 plot 'file.dat' index STATS_blocks-1
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
index? Try gnuplot online help.