Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Correct format for 3D plots datas

Anonymous
2010-04-06
2013-02-10

  • Anonymous
    2010-04-06

    Hello all

    I would like to plot a surface with gnuplot. My problem is that if I do :

    gnuplot> splot "test.dat" with lines
    gnuplot>
    

    I got a plot like that : see the plot

    You can see that there is two line which cross all the other on each lines. How can I remove them ?

    I supposed that it comes from the  way I wrote my data file. This is a part of it :

        8.0000    0.0000    2753.9172652
        8.0000    5.0000    2673.4428250
        8.2000    5.0000   -9164.8254215
    
        8.0000    5.0000    2673.4428250
        8.0000   10.0000    2452.5143323
        8.2000   10.0000   -9149.5444934
    
        8.0000   10.0000    2452.5143323
        8.0000   15.0000    2144.8587026
        8.2000   15.0000   -9117.5872329
    ...
        8.0000   85.0000    2358.2021493
        8.0000   90.0000    2377.3923995
        8.2000   90.0000   -7260.4473280
    
        8.2000    0.0000   -9169.1781257
        8.2000    5.0000   -9164.8254215
        8.4000    5.0000  -11106.5405234
    
        8.2000    5.0000   -9164.8254215
        8.2000   10.0000   -9149.5444934
        8.4000   10.0000  -11063.0436958
    ...
    

    As you can see, first y goes from 0 to 90 and next I increament x. May be it is that the problem ?

    Thank you for you help

     
  • It's really quite simple -- you put superfluous data points into your file.  You must increment x, and jump back from y=90 to y=0, in one jump.   So instead of this:

    [quote]
    8.0000 85.0000 2358.2021493
    8.0000 90.0000 2377.3923995
    8.2000 90.0000 -7260.4473280
    8.2000 0.0000 -9169.1781257
    8.2000 5.0000 -9164.8254215
    [/quote]
    

    you should have this:

    8.0000 85.0000 2358.2021493
    8.0000 90.0000 2377.3923995
    8.2000 0.0000 -9169.1781257
    8.2000 5.0000 -9164.8254215