Results 1 to 3 of 3
I don't know if this is the correct place for this, but I wanted to graph in gnuplot one column of a data file using the formula y=mx+b... where m ...
- 07-03-2009 #1Just Joined!
- Join Date
- Jun 2009
- Location
- New York
- Posts
- 12
plotting a data file in ginuplot in linux
I don't know if this is the correct place for this, but I wanted to graph in gnuplot one column of a data file using the formula y=mx+b... where m is a constant and b is a constant...x is the data and y is unknown. I known how to move that one column of data to its own file and that's what I have done. I need a code for the mx+b graph though...I obviously know how to apply that formula but I don't know how to make gnuplot do it for a very large number of data point (x). Please help
Because I did not know how to make a line like that with many x values in gnuplot, I just found 2 points by solving for two specifc x's...this did work but once I graphed the line I could not figure out how to extend the line further than those two points...
~So if it is possible to extend the line of thosetwo points then what is the code? ... would doing a best fit line for those two points give me the line for all of those data points? If so...how do I do that?
~If not, then what is the code to just graph all of those data points for x?
Any suggestions are appreciated.
Thanks
- 07-08-2009 #2
So you basically have a column of data (which we will call x) and you want to plot coordinates by using that x and a y which is a formula?
I suspect this will work:
You will obviously need to fill in m and b.Code:plot "datafile.dat" using 1:(m * $1 + b)
This works by telling plot which columns to use. Here we say that the first column will be used for the x value, and the expression that we have given will be used for the y value. In that expression, $1 refers to the first column of the datafile.
I hope this helps! You can learn more at:
UsingDISTRO=Arch
Registered Linux User #388732
- 07-11-2009 #3Just Joined!
- Join Date
- Jun 2009
- Location
- New York
- Posts
- 12
Thankyou SO much, it did work, I've been trying to figure it out forever..


Reply With Quote
