Results 1 to 3 of 3

Thread: gnuplot multiplot

  1. #1
    Join Date
    May 2013
    Beans
    1

    Question gnuplot multiplot

    Hello everyone,

    im trying to create a special graphic with gnuplot and dont really get where i want.

    What i want to do is this:
    I have 20 textfiles containing 8000x2 matrices, where the first column represents the time and the second the amplitude of a wave.
    Now all 20 wave-functions shell be plotted in one graphic, that way that there is a vertical offset between them.

    The graphic should look like the one i attached to this post, where 60 functions a plotted above each other.

    Does anybody now how to get there?


    Thanks for reading
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,044
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: gnuplot multiplot

    I would make a copy of all data files to a second directory, then write a script to add a Y field to the data with the correct offset.

    I don't know how to do it in gnuplot directly, but I did find this:

    http://stackoverflow.com/questions/5...ing-in-gnuplot

    It basically uses a math function to add the offset on the fly to the data.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  3. #3
    Join Date
    Apr 2012
    Beans
    7,256

    Re: gnuplot multiplot

    I agree - a simple 2D plot with a suitably calculated offset

    Have a look at this blog for how to do it directly in gnuplot --> http://gnuplot-tricks.blogspot.ca/20...udo-files.html

    For example, if I generate 21 files called sol-0, sol-1, ... , sol-20 then I can do:

    Code:
    gnuplot> unset key
    gnuplot> set style data points
    gnuplot> filename(n) = sprintf("sol-%d", n)
    gnuplot> plot for [n=0:20] filename(n) using 1:(column(2) + n-20 + 10) linetype 1 pointtype 1
    giving

    gnuplot-fileloop.png

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •