Menu

#171 pm3d interpolate gives changing results

closed-out-of-date
nobody
None
2
2008-01-11
2007-02-13
No

I still work with pm3d on non grid data.

Using pm3d on grid data and afterwards choosing a
non grid subset of the data for plotting, results in
different color maps not only close to border (where
it would be acceptable) but also inside the area,
where all data points are as before!!

I attached a zip with all data and plt-file to
demonstrate.

I think it is necessary to optimise the interpolation
module of pm3d.

Discussion

<< < 1 2 (Page 2 of 2)
  • Michael Hecht

    Michael Hecht - 2007-02-16

    Example of pm3d interpolate mis-behaviour

     
  • Michael Hecht

    Michael Hecht - 2007-02-16

    Logged In: YES
    user_id=1701062
    Originator: YES

    Here I am again and do my very best:

    I generated an artificial data file called "testdata.txt" (5x5 matrix).
    From this I derived two data sets called "testdata_remove.txt" and "testdata_NaN.txt" where
    I removed unwanted data or set them to 'NaN'.

    If you load now "settings.plt" you can plot afterwards:

    splot "testdata.txt"
    splot "testdata_remove.plt"
    splot "testdata_NaN.txt"

    I added two jpegs with the resulting figures as well as the handmade version of what I expected to get.

    You can easily check other combinations of "ftriangles" "flush ..." ore anything else.
    I was whith no combination able to get the desired result.

    I hope this is sufficient, as detailed as necessary and as simple as possible. :-)

    File Added: pm3dSimpleExample.zip

     
  • Ethan Merritt

    Ethan Merritt - 2007-02-16

    Logged In: YES
    user_id=235620
    Originator: NO

    I'm not sure I want to stick my toe in the waters, as there are sharks circling, but...

    Isn't the long and short of your problem that you are expecting interpolation to exactly regenerate missing data? That is not a reasonable expectation.

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-16

    Logged In: YES
    user_id=31505
    Originator: NO

    The trouble is that gnuplot does not distinguish "missing" and "undefined" data.

    It turns out again that uttermost simplification of your demo is the key point to success! In your case, simplifying everything leads to this datafile s.dat:

    0 0 1
    1 0 2
    2 0 3

    0 1 2
    1 1 3
    2 1 NaN

    and this sequence of commands:

    reset
    set term pop
    set pm3d map ftriangles
    #set datafile missing 'NaN'

    #splot "s.dat"
    splot "s.dat" using 1:2:3
    #splot "s.dat" using 1:2:($3)

    set table
    replot

    You may be surprised that "pm3d interpolate" is not there at all!

    Taking those # on and off, you see different behaviour. You can tune it to get what you want. In your case of "testdata_*.txt" files, you obviously wish this combination:

    #set datafile missing 'NaN'
    splot "testdata_remove.txt" using 1:2:3
    splot "testdata_NaN.txt" using 1:2:3

    It's crazy that setting a "missing" string makes those points present but undefined (aka truely NaN), while not setting it missing makes them really missing...

    That topic has been discussed on gnuplot-beta mailing list some months ago, please have a look to the archive. I think it was decided not to change it for 4.2 as it could break existing scripts, and later implement an "set datafile undefined" or so.

    Hopefully I made it clear now, and gave you a clue what to do with your true data.

     
  • Michael Hecht

    Michael Hecht - 2007-02-17

    Better solution for boundary smoothing

     
  • Michael Hecht

    Michael Hecht - 2007-02-17

    Logged In: YES
    user_id=1701062
    Originator: YES

    Dear sfeam,

    you can be sure, I don't want to get my original data "wizardlike" get restored.
    But I attached an example where I made the inter-/extrapolation myself, starting from
    "testdata_removed.txt". As you can see, there is much more possible than offered
    by pm3d interpolate.
    File Added: betterInterpolation.jpg

     
  • Michael Hecht

    Michael Hecht - 2007-02-17

    Logged In: YES
    user_id=1701062
    Originator: YES

    Petr,

    meanwhile I also recognised this "hidden" behaviour of "datafile missing".
    The changing behaviour is now clear.

    But this doesn't help for solving my "interpolate" problem, does it?

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-17

    Logged In: YES
    user_id=31505
    Originator: NO

    Yes it does:

    #set datafile missing 'NaN'
    splot "xxxxxxx.dat" using 1:2:3

     
  • Michael Hecht

    Michael Hecht - 2007-02-17

    Logged In: YES
    user_id=1701062
    Originator: YES

    No, it doesn't!
    With NONE of the configurations I get a figure from the "testdata_remove.txt" or
    "testdata_NaN.txt" as shown in "betterInterpolation.jpg" on the lower right,
    but this is exactly what I want!

    In the figure on the upper right the data is displayed wrong, since e.g. in the
    INNER!!! rectangle x=3..4, y=3..4 the original data is different, i.e. it's not only
    a problem of the borders!!!

    So I want neither the lower left nor the upper right figure.

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-18

    Logged In: YES
    user_id=31505
    Originator: NO

    The following:

    reset
    set auto fix
    set pm3d map ftriangles interpolate 4,4 flush end
    splot "b.dat" using 1:2:3

    b.dat:

    0 0 1
    1 0 2

    0 1 2
    1 1 3
    2 1 3

    had a bug, resulting in not-optimal colouring, and in "flush begin|end". Was it your problem? I've just committed the patch to sourceforge, so please get the source and recompile gnuplot yourself to test it.

    Otherwise, it's up to you to prepare your data in order to see what you want to see. Recommendation: don't use NaN.

    I hope this is the end of this story. Thanks for finding the bug.

     
  • Michael Hecht

    Michael Hecht - 2007-02-18

    Logged In: YES
    user_id=1701062
    Originator: YES

    For the testdata it looks really much better, close to what I expected.

    Now I will try to compile gnuplot myself - which will take a while, since I never did
    this before. But I'm sure (hope) the patch will be a part of the next precompiled
    gnuplot rc for windows.

    Thank you very much for your assistence.

     
  • Ethan Merritt

    Ethan Merritt - 2008-01-11
    • status: open --> closed-out-of-date
     
  • Ethan Merritt

    Ethan Merritt - 2008-01-11

    Logged In: YES
    user_id=235620
    Originator: NO

    It looks to me that this issue was resolved, so I am closing the report.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.