top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to make of use of GNUPLOT in Linux for plotting graphs by taking inputs from files?

+8 votes
911 views

How to make of use of GNUPLOT in Linux for plotting graphs by taking input from files? Data in one file represents X-axis and other file data represents Y-axis. Can anyone help me out?

posted Feb 6, 2014 by Gurpreet Singh Matharoo

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Datafile for gnupot looks like this
# X      Y
10000.0 0.01
100000.0 0.05
1000000.0 0.45

So you can pick line by line from each file i.e. file containing X and Y and merge them then use gnupot. Let me know if you need some help in that...

2 Answers

+2 votes

Traditionally, gnuplot data files contain multiple columns, e.g.:

# x y
  1 2
  5 10
  6 12

gnuplot does not support two single-column files, so I think you need to merge two files, e.g.

plot "< join file1.dat file2.dat"

if I remember right....

As an aside, if you are going to be doing any data manipulation or regression or such, I'd consider moving to R.

answer Feb 6, 2014 by anonymous
+2 votes

You have to first merge file1 and file2 like this:

paste file1 file2 > merged

then you can plot what you want in gnuplot:

plot "merged" 1:2
answer Feb 7, 2014 by anonymous
Similar Questions
+2 votes

I have a IP configured which is not visible for another network (suppose IP: A).
I have a common machine/switch which is in between two networks, now need to set up IP forwarding such a way that the packets coming to IP: A should be forwarded to that machine correctly.

+1 vote

Can someone describe in detail about the Ghost security hole. And is there any patch or a solution to fix it?

...