How to plot specific rows in GNUplot -


i have two-column file has 1000000 entries, 1000000 rows, don't want plot data, want plot points every 100 lines? how in gnuplot? also, possible specify particular rows plot in gnuplot?

you have @ least 2 options here. first, check out documentation help datafile every

plot 'datafile' every 100 using 1:2  

another option use pseudo-column 0 (help datafile using pseudo) in conjunction ternary operator (help ternary) , knowledge gnuplot silently ignores undefined numbers filter lines:

plot 'datafile' u ( ((int($0)%100)==0)? $1 : 1/0 ):2 

you can make little more easy understand if use macro:

set macro line_number='int($0)' plot 'datafile' u ( ( ( @line_number % 100 ) == 0 ) ? $1 : 1/0 ) : 2 

note include second because (in principle) use select strange line numbers datafile (e.g. 1,100,1000,10000) can't using every -- e.g.

plot 'datafile' u ( ((@line_number == 1 || @line_number == 100 || @line_number == 1000 ) $1:1/0)):2 

also see answers this question


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -