Gizmo plots and gridlines
masheroz
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
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.
July 31, 2015 at 09:08 am - Permalink
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
July 31, 2015 at 09:14 am - Permalink
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.August 5, 2015 at 05:35 am - Permalink
I'll give it a go.
August 5, 2015 at 06:38 pm - Permalink