Hi,
Actually, the SPECTRUM1 is a graph object, that is to say, you can use the GraphObject to control SPECTRUM1. If you want to remove the SPECTRUM1 from the graph layer, please use the RemoveGraphObject method. If the SPECTRUM1 does not exist in the layer, use the following line to add it.
LT_execute("spectrum;"); // add spectrum1
The code below is used to set the SPECTRUM1 position.
void layer_set_spectrum1()
{
GraphLayer gl = Project.ActiveLayer(); // get the active graph layer
if(!gl)
return;
GraphObject go = gl.GraphObjects("spectrum1"); // get the spectrum1
if(!go) // if the spectrum1 not exist
{
LT_execute("spectrum;"); // add spectrum1
go = gl.GraphObjects("spectrum1"); // get spectrum1
}
// set position of spectrum1
go.X = 0;
go.Y = 0;
// refresh the graph
gl.GetPage().Refresh();
}
Also, you can get more examples on setting colormap.
Penn