• Generate `surf`-like plot from `scatter` base

    From Michele Esposito Marzino@21:1/5 to All on Wed Jan 11 07:37:32 2023
    Hi everyone,

    firstly, I'm quite new to GNUPlot (Just subscribed to this group :) ), so I do apologise if I might sound silly.

    I need to visualise some 3D data.

    I'd like to show you all a graphical example of what I have put in place, but I don't see how to do it (maybe it is not possible?).

    If you'd want to, here's the SO link where I posted the same question: https://stackoverflow.com/questions/75084396/gnuplot-generate-surf-like-plot-from-scatter-base

    I try to explain (tough very hard to transmit) by words (or go to the link for a better understanding/visualisation).

    I now generate a scatter-like plot, meaning I have the whole list oh (x, y, z) values for all points.

    Is there a way to finally visualise data layed down like that as a surf-like plot, WITHOUT HAVING TO GENERATE A GRID-MESH ?

    Thanks to everyone answering.

    Michele

    The script I have up to know:
    ```
    # Main window settings
    MAINFONT = ""
    WINDOWTITLE = "BRM (mesher)"
    WSIZEW = 3040 # base: 1980
    WSIZEH = 2080 # base: 1080
    set term wxt \
    size WSIZEW, WSIZEH \
    position 50, 50 \
    font MAINFONT title WINDOWTITLE


    #
    # commands taken from GNU demo folder
    #

    # unset hidden3d
    # set parametric
    set view 45, 45
    set border linestyle 102 linewidth 2


    # draws a grid in the XY plane (at the base)
    # set style line 102 lc rgb "#d6d7d9" lt 0 lw 1
    set grid back ls 102


    #
    # setting styles
    #

    LINETYP = 8
    LINEWDT = 2
    POINTTY = 7
    POINTIN = 0
    POINTSZ = 1

    # "#AARRGGBB"
    set style line 1 linecolor rgb "#B5000000" \
    linetype LINETYP linewidth LINEWDT \
    pointtype POINTTY pointinterval POINTIN pointsize POINTSZ

    set style line 2 linecolor rgb "#B5EEEEEE" \
    linetype LINETYP linewidth LINEWDT \
    pointtype POINTTY pointinterval POINTIN pointsize POINTSZ
    set style data points


    # #
    # # LEGEND (related)
    # #
    # LEGENDTITLE = "brm"
    # set key nobox \
    # title LEGENDTITLE

    #
    # Annotation: title and labels
    #
    FIGURETITLE = "Bispectrum (MESHER)"
    XLABEL = "f_1"
    YLABEL = "f_2"
    set title FIGURETITLE
    set xlabel XLABEL
    set ylabel YLABEL

    # ??
    set ticslevel 0.1


    #
    # RANGES
    #
    _xrange = 0
    _yrange = 0

    _xrangev_min = -0.58
    _xrangev_max = 0.58
    if (_xrange == 0) \
    set autoscale x; \
    else \
    set xrange [_xrangev_min : _xrangev_max]

    _yrangev_min = -0.58
    _yrangev_max = 0.58
    if (_yrange == 0) \
    set autoscale y; \
    else \
    set yrange [_yrangev_min : _yrangev_max]


    # by default, always autoscale Z axis
    set autoscale z

    #
    # PALETTE (???)
    #
    set palette defined


    #
    # DATA file - ACTUAL PLOTTING (end of script)
    #
    DATAFILE = "brm_gnu.dat"
    splot DATAFILE linestyle 1

    set terminal png transparent \
    size WSIZEW, WSIZEH \
    truecolor enhanced
    set out 'brm_gnu.png'
    splot DATAFILE linestyle 2
    ```

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Buxton@21:1/5 to All on Wed Feb 1 06:12:55 2023
    Sorry, I can't think of an answer. I know you said that you didn't want to grid the data, but your example of what you want it to look like is gridded?

    dgrid3d is the way to do the gridding in gnuplot.

    If you need to create a contour plot of irregularly spaced data in Octave/Matlab then you would need to first grid it to, which looks like the example you provided?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)