Hi Jay,
Here is one way to do this:
Easwar
OriginLab
void plot_range()
{
// Point to active worksheet
Worksheet wks = Project.ActiveLayer();
if( !wks ) return;
// Create curve object that attaches to Col(L) as Y, and Col(E) as X
string strWksName = wks.GetPage().GetName();
Curve crv(strWksName + "_L", strWksName + "_E");
// Or use constructor with index number
// Curve crv(wks, 11, 4);
// Note that there are many curve constructors, some of which that
// directly attach to the data, and some that attach to a copy
// In your case you want to attach to the data directly
if( !crv ) return;
// Create a graph page and add curve to layer
GraphPage gpg;
// Use default Orign.otp or one of your custom templates
gpg.Create("Origin");
// Point to active layer and add curve
GraphLayer gly = gpg.Layers(-1);
if(! gly ) return;
gly.AddPlot(crv);
// Get the active data plot object in layer and set range
DataPlot dp = gly.DataPlots(-1);
if( !dp ) return;
dp.SetRange(100, 200);
// Rescale layer
gly.Rescale();
}