Author |
Topic |
|
dkudlay
USA
22 Posts |
Posted - 11/18/2009 : 6:44:35 PM
|
How do I correlate the plot types listed in Plot->Special (Such as Vector XYAM) with IDM_PLOT_ values needed for AddPlot function? |
|
Iris_Bai
China
Posts |
Posted - 11/19/2009 : 01:43:41 AM
|
Hi,
Origin C GraphLayer::AddPlot not support this special plotting, you can use Labtalk.
Before running, need to hight-light columns.
void VectorPlot()
{
Worksheet wks = Project.ActiveLayer();
if( wks )// if active window is worksheet
{
LT_execute("worksheet -P 208 vector");
}
}
The following Origin C codes help to select columns in worksheet:
void SetDataSelection()
{
Worksheet wks = Project.ActiveLayer();
if( wks )
{
Column col = wks.Columns(0);
int nRows = col.GetUpperBound();
vector<int> vR1, vR2, vC1, vC2;
vR1.Add(0); // first row
vR2.Add(nRows); // last row
vC1.Add(0); // first column
vC2.Add(3); // 4th column
// to select 4 columns
wks.SetSelectedRange(vR1, vC1, vR2, vC2);
}
}
Iris |
|
|
dkudlay
USA
22 Posts |
Posted - 11/19/2009 : 6:00:48 PM
|
Thanks again Iris, this worked very well. The only question I have, is I couldn't find the info on what the contents to the LT_execute command mean. I assume -P 208 is a plot Id and vector is a parameter to it. Where are the definitions for the special graph IDs? I am particularly interested in the Zoom and Polar/Rose types. |
|
|
dkudlay
USA
22 Posts |
Posted - 11/19/2009 : 7:37:16 PM
|
Also, just wanted to add, I was adding 2 plots to same graph. After using the LT_execute solution, I could not access the axis to manipulate them using Tree and GetFormat. To solve the problem, I Rescaled the first layer with my Plot, and then I got next layer, added a plot via LT_execute, changed the axis, and then rescaled that. |
|
|
Iris_Bai
China
Posts |
Posted - 11/19/2009 : 8:41:41 PM
|
quote: Originally posted by dkudlay
Thanks again Iris, this worked very well. The only question I have, is I couldn't find the info on what the contents to the LT_execute command mean. I assume -P 208 is a plot Id and vector is a parameter to it. Where are the definitions for the special graph IDs? I am particularly interested in the Zoom and Polar/Rose types.
Hi,
worksheet -p is Latbalk Script, 208 is Plot ID, Vector is graph template, more details about worksheet command please reference to Labtalk Help.
Please see Origin C Plotting Examples, I added many new examples today, and will add more and more soon. This page included many plotting examples, for example Zoom Plot, Polar Plot, Wind Rose Plot, Vector XYAM Plot, Vector XYXY Plot and so on.
Iris |
Edited by - Iris_Bai on 11/20/2009 05:31:00 AM |
|
|
Iris_Bai
China
Posts |
Posted - 11/19/2009 : 8:43:59 PM
|
quote: Originally posted by dkudlay
Also, just wanted to add, I was adding 2 plots to same graph. After using the LT_execute solution, I could not access the axis to manipulate them using Tree and GetFormat. To solve the problem, I Rescaled the first layer with my Plot, and then I got next layer, added a plot via LT_execute, changed the axis, and then rescaled that.
Hi, I am not sure what you mean. If want to rescale the multiple layers in one graph, need to resacle layers one by one.
foreach(GraphLayer gl in gp.Layers)
{
gl.Rescale();
}
Iris |
|
|
dkudlay
USA
22 Posts |
Posted - 11/20/2009 : 1:05:53 PM
|
Thank you Iris, I tried the Zoom Sample you posted, works like a charm, thanks. |
|
|
|
Topic |
|
|
|