Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Applications > plotting a data file in ginuplot in linux

Forgot Password?
 Linux Applications   I cant get "X" app to work... also discussion about linux programs.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 07-03-2009   #1 (permalink)
LRG
Just 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
LRG is offline  



Reply With Quote
Old 07-08-2009   #2 (permalink)
Trusted Penguin
 
Cabhan's Avatar
 
Join Date: Jan 2005
Location: Boston, MA, USA
Posts: 2,774
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:
Code:
plot "datafile.dat" using 1:(m * $1 + b)
You will obviously need to fill in m and 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:
Using
__________________
DISTRO=Ubuntu
Registered Linux User #388732
Cabhan is offline   Reply With Quote
Old 07-11-2009   #3 (permalink)
LRG
Just 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..
LRG is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 04:50 AM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1