Gizmo plots and gridlines

I have some gizmo plots on which it would be informative to plot the gridlines so you can easily see what is going on.

Is there a way to only draw every 2nd or 5th (or nth) gridline, whilst still calculating and displaying the plot at every grid point?

modifygizmo/n=gizmo0 modifyobject=surface0, property={ystep, 5} will change the grid in the y-direction, but will degrade the surface quality
Thirty years ago it was common to plot surfaces using grid-lines. In fact, the only algorithm that was usable on a desktop computer involved a pen plotter drawing grid lines. Gizmo implements surface grid lines for some applications where the addition of the grids might enhance the appearance of the surface. I have yet to encounter an instance where it actually does. In other words, I strongly recommend that you display a filled surface and use light and shading instead of grid lines.

A gridded surface depends on the sampling of the grid. If you choose grid lines that are too far apart, your surface will be under-sampled; that should be obvious. If you can't live without the grid lines then you might consider creating another surface object that uses filled surface. Add it to the display list above your gridded surface and apply transparency so that you can see your under-sampled grids on top of the fully sampled surface.

I hope this helps,

A.G.
WaveMetrics, Inc.
Here is one not very elegant work-around. Make and show two surfaces of the same wave; use one for the high-resolution filled-surface display without grid-lines and the other without surface fill but with sparser grid-lines. You will probably have to use reduced alpha and a blend function to get some degree of transparency on the filled surface for best display of the other surface's grid lines. Those lines will not be smooth but the filled surface will be. Here is some code as an example.
#pragma rtGlobals=3     // Use modern global access method and strict wave access.

function test() // make Gizmo wave for surface test
    make/O/N=(101,101) wave0
    setscale/I x, -1, 1,"" wave0
    setscale/I y, -1, 1,"" wave0
    wave0 = exp( -4*(x^2+y^2))
end

Window Gizmo0() : GizmoPlot
    PauseUpdate; Silent 1   // Building Gizmo 6 window...

    // Do nothing if the Gizmo XOP is not available.
    if(exists("NewGizmo")!=4)
        DoAlert 0, "Gizmo XOP must be installed"
        return
    endif

    NewGizmo/N=Gizmo0/T="Gizmo0"
    ModifyGizmo startRecMacro
    MoveWindow 436.5,62,624,212
    AppendToGizmo Surface=root:wave0,name=surface0
    ModifyGizmo ModifyObject=surface0 property={ srcMode,0}
    ModifyGizmo ModifyObject=surface0 property={ surfaceCTab,Rainbow}
    ModifyGizmo ModifyObject=surface0 property={ inverseSurfaceCTAB,1}
    ModifyGizmo ModifyObject=surface0 property={ surfaceCTABAlpha,0.95}
    ModifyGizmo setObjectAttribute={surface0,blendFunc0}
    AppendToGizmo Surface=root:wave0,name=surface1
    ModifyGizmo ModifyObject=surface1 property={ surfaceColorType,1}
    ModifyGizmo ModifyObject=surface1 property={ lineWidthType,1}
    ModifyGizmo ModifyObject=surface1 property={ fillMode,1}
    ModifyGizmo ModifyObject=surface1 property={ srcMode,0}
    ModifyGizmo ModifyObject=surface1 property={ frontColor,1,0,0,0}
    ModifyGizmo ModifyObject=surface1 property={ backColor,0,0,1,0}
    ModifyGizmo ModifyObject=surface1 property={ xStep,10}
    ModifyGizmo ModifyObject=surface1 property={ yStep,10}
    AppendToGizmo attribute blendFunc={770,771},name=blendFunc0
    ModifyGizmo setDisplayList=0, object=surface1
    ModifyGizmo setDisplayList=1, object=surface0
    ModifyGizmo SETQUATERNION={-0.185025,0.394343,0.794830,-0.422498}
    ModifyGizmo autoscaling=1
    ModifyGizmo currentGroupObject=""
    ModifyGizmo compile

    ModifyGizmo showInfo
    ModifyGizmo infoWindow={494,383,994,641}
    ModifyGizmo bringToFront
    ModifyGizmo endRecMacro
End
The solutions that AG and I proposed are somewhat deficient because the sparse grid lines may have coarse linear segments that may not lie close enough to the smoother surface for your taste. A fix is to create your own smooth surface grid lines using Gizmo Path objects. This will require extra coding. Here is some procedure code to illustrate one method, which makes a 1D xwave, ywave, and zwave for each grid curve, and assembles them into a triplet wave for a Gizmo Path.
function test()
    make/O/N=(101,101) wave0
    setscale/I x, -1, 1, "" wave0
    setscale/I y, -1, 1, "" wave0
    wave0 = exp(-2*(x^2+y^2))  // 2D surface
   
    make/O/N=101 xwave, ywave, zwave
    setscale/I x, -1, 1,"" xwave, ywave
   
    xwave = 0  // grid curve on surface at x=0
    ywave = x
    zwave =wave0(xwave)(ywave)
    make/O/N=(101,3) xgrid0  // triplet for Gizmo path
    Concatenate/O/DL {xwave, ywave, zwave}, xgrid0
   
    xwave = x  // grid curve on surface at y=0
    ywave = 0
    zwave = wave0(xwave)(ywave)
    make/O/N=(101,3) ygrid0
    Concatenate/O/DL {xwave, ywave, zwave}, ygrid0
end

I am attaching a Gizmo figure showing the results of the above code.
(1) you can do this manually for a few grid lines, or figure out how to write a loop and program a sequence of triplet wave generation. Then, adding to Gizmo will require code using EXECUTE for each ModifyGizmo operation.
(2) it is probably cleaner to lump such grid lines into a Gizmo Group (as I did in my test example). Use ModifyGizmo userLevel=9 to add a Group object from the Gizmo info window.
GizmoGrid.PNG