The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 IDM_PLOT_ for Plot -> Specialized
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dkudlay

USA
22 Posts

Posted - 11/18/2009 :  6:44:35 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

dkudlay

USA
22 Posts

Posted - 11/19/2009 :  6:00:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

dkudlay

USA
22 Posts

Posted - 11/19/2009 :  7:37:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

Iris_Bai

China
Posts

Posted - 11/19/2009 :  8:41:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Iris_Bai

China
Posts

Posted - 11/19/2009 :  8:43:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

dkudlay

USA
22 Posts

Posted - 11/20/2009 :  1:05:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Iris, I tried the Zoom Sample you posted, works like a charm, thanks.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000