This example demonstrates how to show active layer only, which does the same thing as we right-click on the layer icon on the upper-left corner of graph and choose Show Active Layer Only.
if( gp )
// to active graph window
// execute the LabTalk command with the active graph window
LT_execute("menu -e 37975;");