#169 contour on non grid data

open
nobody
None
5
2013-02-10
2007-02-08
No

I have a problem with contours which might be
corrected in coming releases.

Since pm3d can interpolate non grid data it might
be possible to learn this to contour. The result would
be a figure like the attached one (which I produced by
hand)

Discussion

  • Michael Hecht

    Michael Hecht - 2007-02-08
     
  • Petr Mikulik

    Petr Mikulik - 2007-02-08

    Logged In: YES
    user_id=31505
    Originator: NO

    No, pm3d does not interpolate data.

    You probably want something else -- that's already in current gnuplot.
    I guess it maybe this FAQ:
    3.14 How to overlay contour plot over pm3d map/surface
    (contours can be or coloured by "with palette").

     
  • Michael Hecht

    Michael Hecht - 2007-02-08
     
  • Michael Hecht

    Michael Hecht - 2007-02-08

    Logged In: YES
    user_id=1701062
    Originator: YES

    Sorry, but this doesn't work (i.e. I tried to do so).
    I always get:

    Notice: cannot contour non grid data!

    So I need to get contours on non grid data which is currently not possible.
    I attached the data to plot which is comparable to the former attached jpeg.
    Maybe it helps to understand the problem.

    I plotted it using mainly:

    set pm3d map interpolate 10,10 ftriangles flush center
    set view map
    splot "nongrid.dat"

    P.S.: pm3d does interpolate data, since the command is: "set pm3d interpolate 10,10"
    P.P.S.: The FAQ might help at my request ID 1655289, even if it is no comfortable solution.
    The only problem I have there is the (unnecessary) connection between contour,
    surface and data
    style

    File Added: nongrid.dat

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-08

    Logged In: YES
    user_id=31505
    Originator: NO

    You must use "set dgrid3d ..." to grid your data for contouring.

     
  • Michael Hecht

    Michael Hecht - 2007-02-08

    Logged In: YES
    user_id=1701062
    Originator: YES

    I tried this, but the result was not what I wanted to get (see the jpeg file I attached at the beginning).
    I don't want a rectangular figure (which I get with "dgrid3d").
    If it is this easy you can surely reproduce (basically) the "contour.jpg" with
    a few lines of gnuplot commands?!
    (If you can I definitely have to send you a little donation)

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-08

    Logged In: YES
    user_id=31505
    Originator: NO

    As I understand it now, you want to see your data only inside the shape of your experimental data? Huh, that's exactly the reason I wrote pm3d long long time ago :-))

    I don't know how to do such a masking. Preprocess your input data, from limiting scans get a curve and from it make a shape "towards infinity" and then fill it in white colour... Ugly indeed.

    Or code a function for the contour alg "set the z-value of points outside of the input data shape to NaN".

    Someone else has a better idea?

     
  • Michael Hecht

    Michael Hecht - 2007-02-09

    Logged In: YES
    user_id=1701062
    Originator: YES

    This is the resason, why I wroter a program what transforms the data like this.

    1. Get data with a grid like structure, but not in a rectangular shape,
    i.e. missing values, but if values available then in a grid
    (this is what you usually get when you make SELECT X,Y,avg(Z) ... GROUP BY X,Y ...
    from a database, you will never get all combinations of all classes)
    2. enhance the data by extrapolation towards x- and y-range
    3. Calculate the convex hull of the original data
    4. restrict extrapolated data to the convex hull
    5. plot it with gnuplot :-)

    I attached an image where you can see the difference between the plot of the original data (not the ones I attached before) and the convex hull inter-/extrapolation.

    still missing

    6. add contours to the non rectangular shape

    All this could really be a powerful enhancement of pm3d!!
    Like:
    set pm3d enhance # to inter and extrapolate to a grid, but dufferent than dgrid3d
    set pm3d convex # display all within convex hull (see wikipedia: graham hull)

    File Added: convexhull.jpg

     
  • Petr Mikulik

    Petr Mikulik - 2007-02-17

    Logged In: YES
    user_id=31505
    Originator: NO

    In summary: This feature request asks for "Draw contours inside a (an explicitly) given area.".

     

Log in to post a comment.