PLGRIDDATA(3plplot)

πŸ’… PLGRIDDATA πŸ’…

okay so this is a page from the PLplot API β€” yes, PLGRIDDATA(3plplot), the grid-data-from-messy-scattered-points queen herself πŸ‘‘ β€” and honestly she's kind of a big deal.


✨ NAME ✨

plgriddata β€” grid data from irregularly sampled data. literally takes your chaotic lil data points and gives them structure. main character energy fr. πŸ¦‹


✨ SYNOPSIS ✨

plgriddata(x, y, z, npts, xg, nptsx, yg, nptsy, zg, type, data)

like, that's the whole vibe. count the args, bestie, there's a lot of them πŸ™ˆ


✨ DESCRIPTION ✨

okay so real talk: real-world data is frequently irregularly sampled 😭 like it just shows up whenever it feels like it. but PLplot's 3D plots are kinda picky β€” they need data organized as a grid, i.e. where the x sample point values are independent of the y coordinate and vice versa. no cap.

so this function is the glow-up transformer πŸ’– it takes irregularly sampled data from the x[npts], y[npts], and z[npts] vectors, reads the desired grid location from the input vectors xg[nptsx] and yg[nptsy], and returns the interpolated result on that grid using the output matrix zg[nptsx][nptsy]. slay.

the algorithm used to interpolate the data to the grid is specified with the argument type, which can have one parameter specified in argument data. that's it, that's the whole system πŸŽ€

Redacted form: General: plgriddata(x, y, z, xg, yg, zg, type, data) Python: zg=plgriddata(x, y, z, xg, yg, type, data)

this function is used in example 21 (go look, iykyk πŸ‘€).


✨ ARGUMENTS ✨

so many args bestie, but we're getting through all of them together 🫢

  • x (PLFLT_VECTOR(3plplot), input) β€” the input x vector. just vibes, just numbers.
  • y (PLFLT_VECTOR(3plplot), input) β€” the input y vector.
  • z (PLFLT_VECTOR(3plplot), input) β€” the input z vector. each triple x[i], y[i], z[i] represents one data sample coordinate. iconic trio behavior πŸ’…
  • npts (PLINT(3plplot), input) β€” the number of data samples in the x, y and z vectors.
  • xg (PLFLT_VECTOR(3plplot), input) β€” a vector that specifies the grid spacing in the x direction. usually xg has nptsx equally spaced values from the minimum to the maximum values of the x input vector 🌸
  • nptsx (PLINT(3plplot), input) β€” the number of points in the xg vector.
  • yg (PLFLT_VECTOR(3plplot), input) β€” a vector that specifies the grid spacing in the y direction. similar to the xg parameter (twins! πŸ‘―).
  • nptsy (PLINT(3plplot), input) β€” the number of points in the yg vector.
  • zg (PLFLT_NC_MATRIX(3plplot), output) β€” the matrix of interpolated results where data lies in the grid specified by xg and yg. therefore the zg matrix must be dimensioned nptsx by nptsy. ⚠️ yes that's a real constraint, don't come for me.
  • type (PLINT(3plplot), input) β€” the type of grid interpolation algorithm to use, which can be:
    • GRID_CSA: Bivariate Cubic Spline approximation
    • GRID_DTLI: Delaunay Triangulation Linear Interpolation
    • GRID_NNI: Natural Neighbors Interpolation
    • GRID_NNIDW: Nearest Neighbors Inverse Distance Weighted
    • GRID_NNLI: Nearest Neighbors Linear Interpolation
    • GRID_NNAIDW: Nearest Neighbors Around Inverse Distance Weighted

for details of the algorithms read the source file plgridd.c πŸ“– (yes, actually read it, it's right there).

  • data (PLFLT(3plplot), input) β€” some gridding algorithms require extra data, which can be specified through this argument. currently, for algorithm:
    • GRID_NNIDW, data specifies the number of neighbors to use, the lower the value, the noisier (more local) the approximation is. 😬 lower = spicier, basically.
    • GRID_NNLI, data specifies what a thin triangle is, in the range [1. .. 2.]. high values enable the usage of very thin triangles for interpolation, possibly resulting in error in the approximation. πŸ’€ so like, be careful with the high values babe.
    • GRID_NNI, only weights greater than data will be accepted. if 0, all weights will be accepted.

✨ AUTHORS ✨

many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. shoutout to the whole squad, absolute legends the lot of them πŸ†πŸ’œ


✨ SEE ALSO ✨

PLplot documentation at http://plplot.sourceforge.net/documentation.php. go read it, it's giving essential πŸ”₯


okay that's the whole page bestie!! this was PLGRIDDATA(3plplot), from the PLplot API, dated August, 2026 β€” and that's the version/source info right there, consider it officially signed off πŸ’–βœ¨πŸŽ€ now go grid some data, you absolute icon πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from