Hi,
Here is an Origin C solution that creates the scatter plot from cols 1,2 of the wks and uses col 3 to set the color map of the scatter points. Once such a function is compiled and ready, you can call it from your LabTalk script or from the Script Window.
void plot_symbol_color_map()
{
// Assumes worksheet with three columns set to
// X, Y, Z where z column contains data to be used
// for color map
//
// Declare worksheet from active layer
Worksheet wks = Project.ActiveLayer();
// Create a new graph page
GraphPage gpg;
gpg.Create();
// Point to layer 1
GraphLayer gly = gpg.Layers(0);
// Make a curve object from cols 1, 2 of wks
Curve crv(wks, 0, 1);
// Plot curve as scatter plot
gly.AddPlot(crv, IDM_PLOT_SCATTER);
// Point to the data plot object for the plot
DataPlot dp = gly.DataPlots(0);
// Change the edge color setting to color map based on col 3
dp.Curve.Symbol.EdgeColor.nVal = 4194405;
// Rescale the layer
gly.Rescale();
}
In the above code, the Edge Color property is set to the value 4194405 which means "use color mapping and get the mapping values from the column right next to the Y column". Currently there are no constants defined for such values. You can determine what value to use by first making an instance of the graph manually in the GUI, and then running code such as below which gets the plot properties to a tree and then dumps the properties to the script window.
void dump_plot_properties()
{
GraphLayer gly = Project.ActiveLayer();
DataPlot dp = gly.DataPlots(0);
Tree tr;
tr = dp.Curve.Symbol;
out_tree(tr);
}
Easwar
OriginLab