Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7660767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:30:36+00:00 2026-05-31T13:30:36+00:00

I have two sets of points: test1.dat and test2.dat, they do not share same

  • 0

I have two sets of points: “test1.dat” and “test2.dat”, they do not share same X-values.

I want to draw two smooth lines first due to the data is noisy, and
then draw a filledcurve between the smooth lines.

I’ve read the tutorial, and cannot find the answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:30:37+00:00Added an answer on May 31, 2026 at 1:30 pm

    piggy-backing off of Raphael Roth’s answer and looking at the gnuplot documentation, you can probably achieve this with a little shell magic for datasets that don’t share X values as well.

    plot '< tail -r test2.dat | cat test1.dat -' using 1:2 with filledcurves closed
    

    One thing that I noticed when testing this out is that you should make sure that you have a newline at the end of test2.dat, otherwise tail -r won’t work correctly (tac would probably work too, but it isn’t installed on my Mac. This works taking the first datafile and appending the second datafile to the first one in reverse. (I am assuming the first and second datafiles are already ordered using ascending X values). In other words, as far as gnuplot is concerned, the data is ascending in x then descending in x. Since we used with filledcurves closed gnuplot treats all the points as a single polygon and then connects them. As far as smoothing the data, that is another question entirely. Just looking at the documentation, gnuplot offers a few smoothing algorithms, but they’ll need to be used on your data ahead of time. The following is completely untested, but hopefully will be something similar to what you want (it will also probably only work in a unix type environment) …

    set table 'smoothed1'
    plot 'test1.dat' using 1:2 smooth beizer  #beizer is just an example see "help plot datafile smooth" for more options
    unset table
    
    set table 'smoothed2'
    plot 'test2.dat' using 1:2 smooth beizer
    unset table
    
    plot '< tail -r smoothed2 | cat smoothed1 -' using 1:2 with filledcurves closed
    

    If it doesn’t work, take a look at the gnuplot generated files “smoothed1” and “smoothed2” and see if that gives you any hints (e.g. are there extra newlines that should be removed?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that contains two sets. They both contain the same key
I have two sets of data points that both relate to the same primary
I have two Sets. Set b is the subset of Set a . they're
I have two separate sets of tables in the same database that model the
I have two types of data sets. Both are in same size. One contains
I have two sets of three (non-collinear) points, in three dimensions. I know the
Here is the problem: I have many sets of points, and want to come
I have two sets of objets and I want to get the intersection of
I got two sets of points S and V, both have the size n.
I have two sets of elements with (sometimes) corresponding rel and id attributes: <a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.