Fitting data in gnuplot with xyerrorbars


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Fitting data in gnuplot with xyerrorbars
# 1  
Old 09-28-2010
Fitting data in gnuplot with xyerrorbars

I was looking at the examples that show how to fit data using gnuplot (ex: gnuplot / misc (2E)) but I can't find a place that shows what to do if I have ranges for the x and y error bars. I tried the common sense:

Code:
gnuplot> fit f(x) "data.txt" using 3:6:4:5:7:8 via a,b
                                                          ^
                            Too many columns in using specification

But I get the error shown above. Any idea why this doesn't work? Because when I plot my data I use:

Code:
plot "data.txt" using 3:6:4:5:7:8 with xyerrorbars

and it works.
# 2  
Old 10-01-2010
Does my question make sense? I am just wondering if the fit function can take the errors in consideration....
# 3  
Old 10-01-2010
Sounds to me like you have "too many columns in using specification" Smilie

One obviously path to solving this could be to look closely at the number of columns in your data and the number of columns in your gnuplot command (specification).
# 4  
Old 10-01-2010
Quote:
Originally Posted by Neo
Sounds to me like you have "too many columns in using specification" Smilie

One obviously path to solving this could be to look closely at the number of columns in your data and the number of columns in your gnuplot command (specification).
I am using 6 columns:
x : y : min x : max x : min y: max y

where min and max are the range of the errors for x and y... when I plot a file withe these columns I get a correct plot, but I can't use the same thing to fit the data... do you know what I mean?
# 5  
Old 10-01-2010
Maybe the utility does not like the spaces between the column names, for example "min x"...

Did you look at some examples?
# 6  
Old 10-01-2010
Can you post some sample data?
# 7  
Old 10-01-2010
Quote:
Originally Posted by verdepollo
Can you post some sample data?
Code:
f(x)= (a*x)+b

fit f(x) "data.txt" using 3:6:4:5:7:8 via a,b

plot "data.txt" using 3:6:4:5:7:8 with xyerrorbars "data", f(x) title "fit line"

Where this is the data file:

Code:
1   NGC1651   9.30096   9.07913   9.4471   9.06064   7.74814   9.60308
2   NGC1711   7.4   7.2   7.6   7.72423   6.78529   8.2304
3   NGC1718   9.3979   9.30096   9.47707   8.32217   7.61273   9.60308
4   NGC1755   7.5   7.3   7.7   8.25522   7.61273   8.51846
5   NGC1777   8.95418   8.84504   9.04134   8.41492   7.69892   9.30529
6   NGC1783   8.95418   8.69891   9.11387   9.03337   7.81286   9.35212
7   NGC1810   7.69891   6.99996   7.95418   6.77811   6.6812   7.68119
8   NGC1818   7.23039   7.20407   7.25523   7.38016   6.70753   7.84505
9   NGC1831   8.60202   8.46235   8.7075   8.74031   8.32217   8.85728
10   NGC1834   7.68119   7.51846   7.79927   7.46235   6.71596   7.91376
11   NGC1836   7.57974   7.4471   7.68119   8.17604   7.53143   8.63341
12   NGC1838   8.09685   7.99996   8.17602   7.79234   6.79235   8.47707
13   NGC1839   7.51846   7.3979   7.61274   7.96843   7.51847   8.43131
14   NGC1844   7.7075   7.67207   7.74029   8.36167   7.67205   8.602
15   NGC1846   9.27868   9.25523   9.30096   9.08273   7.70752   9.60308
16   NGC1847   7.20407   7.07913   7.30096   7.67205   6.75583   8.32217
17   NGC1850   7.60202   7.47707   7.69891   7.91903   7.44711   8.43131
18   NGC1854   7.47707   7.30096   7.60202   7.74814   6.78529   8.36167
19   NGC1856   7.90302   7.69891   8.04134   7.88076   6.79235   8.53142
20   NGC1858   7.23039   7.04134   7.36168   6.70753   6.54403   6.75583

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Gnuplot Same Data Two Axes Different Units)

I'm pretty familiar with Gnuplot, but I've never actually come across a reasonable solution to this problem and I'm hoping someone can help me out! I think it's because I don't know how to pose the problem neatly, so please bare with me. Also new to the forum....so yeah... I have one data set (x... (3 Replies)
Discussion started by: TC69
3 Replies

2. Shell Programming and Scripting

Gnuplot Time Data Question

I have a data file of the following format: servername,2013-05-11 17:46:03,SomeText,195,195,11,202 servername,2013-05-11 17:47:03,SomeText,192,192,23,103 servername,2013-05-11 17:48:03,SomeText,189,190,14,117 servername,2013-05-11 17:49:03,SomeText,196,195,24,231 ... ... I want to... (0 Replies)
Discussion started by: BeeryM
0 Replies

3. UNIX for Dummies Questions & Answers

Output all files fitting the pattern

Hi there I need to create 1 line pipe that outputs list of files whose second character is digit in reverse order (file is a directory and called /tmp)the way I did ls /tmp | grep '^.]*' | sort -r dunno it does not seem working. I tried to do it with another directory that I am sure contain a... (8 Replies)
Discussion started by: FUTURE_EINSTEIN
8 Replies

4. Shell Programming and Scripting

Parsing file: preparing data for charts (gnuplot, calc,...)

Hi there, I have files (tsv) like this: CTLPort IO Rate(IOPS) Read Hit(%) Write Hit(%) Timestamp 0A 136 97 100 09:36:48 0B 3 100 100 09:36:48 0C 88 35 100 09:36:48 0A 87 100 100 09:37:49 0B 3 97 100 09:37:49 0C 83 45 100 09:37:49 0A 108 83 100 09:38:48 0B 3 100 100 09:38:48... (1 Reply)
Discussion started by: gray380
1 Replies

5. UNIX for Dummies Questions & Answers

Fitting a range of data

Hi, I am able to write an awk program that fits using the chi squared minimization method for each number is a data column... but I am wondering if it is possible to do that for a range of numbers at the same time. If I have a column for the observed data... and then say 10 columns for... (13 Replies)
Discussion started by: cosmologist
13 Replies

6. Shell Programming and Scripting

placeholder in gnuplot data

My input data has occasional holes in it, spots where a sensor couldn't be read. These are ERR in the data file instead of a floating point number. What should I change them to, for gnuplot to ignore these values instead of whining about them? (1 Reply)
Discussion started by: Corona688
1 Replies

7. UNIX for Dummies Questions & Answers

Gnuplot - Histogram Fitting

Hi I am trying to fit my histogram data with a gaussian model and am encountering two problems: 1. I can't seem to fit the histogram data with a model fit y(x) 'bin.txt' using 2:xtic(1) via a,b,c (error: need 2 to 7 using specs) 2. Even when I manually guess the correct parameters for my fit and... (1 Reply)
Discussion started by: goffinj
1 Replies

8. Programming

GNUPLOT- how to change the style of data points

Hi, I am trying to arrange my graphs with GNUPLOT. Although it looked like simple at the beginning, I could not figure out an answer for the following: I want to change the style of my data points (not the line, just exact data points) The terminal assigns first + and then x to them but what I... (0 Replies)
Discussion started by: natasha
0 Replies

9. UNIX for Advanced & Expert Users

Gnuplot question: plotting 3D data in map view

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - map view (no 3D view) - color of each point should depend on z-value. - I want to define my own color scale - plot should... (1 Reply)
Discussion started by: karman
1 Replies
Login or Register to Ask a Question