Adding multiple data sets together

View: New views
4 Messages — Rating Filter:   Alert me  

Adding multiple data sets together

by cmartin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm trying to find a way to add two data sets(contained in different files) together and plot the result.  Is there any easy way of doing this.  For example, is there any way of creating a function, say f(x), which contains your data set?  If that is possible, then I could just read my data files into two functions, f(x) and g(x),  and then plot f(x)+g(x)

Thanks for any help
Chris

Re: Adding multiple data sets together

by cmartin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Julien Derr wrote:
I guess the easy way of doing it is to paste the two files in one, and  
then plot normally....with $1+$2
The problem with this method is that my files are quite large and I have a few thousand of them(I have a C program which does this analysis for me, but I need to double check the results for some of them),  so to add another column to my output would nearly double my program's running time(which is already at more than an hour, and already dominated by read-write time)

Re: Adding multiple data sets together

by Dieter Jurzitza :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Chris,
you could probably do a little awk magic and pipe the resulting data into
gnuplot. You would have to open both files in awk (in perl ...), add the two
values and pipe the result into gnuplot, where you'd plot them.
If your files are that large as you describe it might be impossible to hold
both the data sets in ram at once (more than 1 hour of writing into a file
from a C-program ought to be quite a bit of data ....)
Hope this helps,
take care



Dieter

--
-----------------------------------------------------------

                               |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------Am Freitag, 9. Mai
2008 20:33:19 schrieb cmartin:
> Hi,
> I'm trying to find a way to add two data sets(contained in different files)
> together and plot the result.  Is there any easy way of doing this.  For
> example, is there any way of creating a function, say f(x), which contains
> your data set?  If that is possible, then I could just read my data files
> into two functions, f(x) and g(x),  and then plot f(x)+g(x)
>
> Thanks for any help
> Chris



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gnuplot-info mailing list
Gnuplot-info@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-info

Re: Adding multiple data sets together

by Tatsuro MATSUOKA-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

--- cmartin <creepy_chris@...> wrote:
> The problem with this method is that my files are quite large and I have a
> few thousand of them(I have a C program which does this analysis for me, but
> I need to double check the results for some of them),  so to add another
> column to my output would nearly double my program's running time(which is
> already at more than an hour, and already dominated by read-write time)
> --
> View this message in context:
> http://www.nabble.com/Adding-multiple-data-sets-together-tp17154106p17154388.html
> Sent from the Gnuplot - User mailing list archive at Nabble.com.

If your data so large, it is better to use binary data.
Please see:

help binary general

Regards

Tatsuro    

--------------------------------------
GANBARE! NIPPON! Win your ticket to Olympic Games 2008.
http://pr.mail.yahoo.co.jp/ganbare-nippon/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gnuplot-info mailing list
Gnuplot-info@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-info