LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2009, 10:52 AM   #1
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Rep: Reputation: 19
GNUplot - plot a subset of a data column


Is there a way to plot only a subset of a column of data in gnuplot? As an example, I have data files that look like this:

Code:
Col1 Col2 Col3
1    0.11 0.11
2    0.11 0.18
3    0.22 0.19
4    0.25 0.20
5    0.28 0.22
6    0.11 0.24
7    0.11 0.11
If I want to plot columns 1 vs 2 and 1 vs 3 WITHOUT the points that are 0.11, how can I do this? I can't just delete the values from the text file because if it sees

Code:
Col1 Col2 Col3
2         0.18
3    0.22 0.19
4    0.25 0.20
5    0.28 0.22
6         0.24
Then row 2 associates 0.18 with column 2 instead of 3, and row 6 uses 0.24 with column 2 instead of column 3.

As it is, all I can do is split the data file into several files, one for each column, and delete the entire row. This seems messy... there's gotta be a better way, but my googling has turned up nothing. Isn't there a way to specify row ranges to use for each column?

Please let me know what I'm missing.

Thanks!
 
Old 08-13-2009, 04:32 PM   #2
ddffnn
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Replace 0.11 with ?:

Code:
Col1 Col2 Col3
1    ?    ?
2    ?    0.18
3    0.22 0.19
4    0.25 0.20
5    0.28 0.22
6    ?    0.24
7    ?    ?
 
Old 03-11-2015, 12:11 PM   #3
Geremia
Member
 
Registered: Apr 2011
Distribution: slackware64-current
Posts: 451

Rep: Reputation: 44
http://stackoverflow.com/a/18239133/1429450

Quote:
Yes. See the every keyword description on page 78 of the gnuplot manual:

http://www.gnuplot.info/docs_4.6/gnuplot.pdf

E.g.

Code:
plot "data.txt" every ::a:A:b:B
should plot data points a through b in data blocks A through B.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing vertical AND horizonal lines in a single gnuplot plot Daravon Linux - Software 0 07-22-2009 04:22 PM
gnuplot - plot horizontal line over shorter range than the axis Meson Linux - Software 5 10-18-2008 08:41 AM
Converting a Histogram data into Scatter Plot data kushalkoolwal Linux - Software 2 09-08-2008 01:19 PM
gnuplot, pull X data from file, specify Y data at cmd line? hedpe Programming 5 03-15-2007 11:32 PM
in gnuplot; move title in plot command? shengchieh Linux - Software 0 12-29-2004 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration