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
 LabTalk Forum
 Get Dataset name from plot with getpts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

SFackler

Germany
4 Posts

Posted - 10/23/2017 :  11:17:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hey fellow Labtalk Fans,

I tried to get data from a plot using the datareader tool. I have a series if linegraphs plotted in a group.

For that I defined the PointProc macro.

Getting the x and y data is no problem. I don't know if my solution is the propper way, but it works.

Getting the name of the dataset proves to be the bigger problem.

I tried using the getpts.data$ methode, but failed. First I think I call it wrong, since it always gets the name of the first curve in the plot I selected and not from the other ones. Also this methode only gives me a reference without the used WorkSheet, like:

Book3_A


If possible, I would like to access the Longname and an User defined parameter of the plotted data.

Is there an example of this in the Labtalk documentation, or does somebody know a solution to this?

Below is my code:


getpts; 

// read x and y from a plot upon pressing enter
// and append it to Book1 in Sheet1
def PointProc{
	range DataSetIdentifier = [Book1]Sheet1!Col(1);
	range xValues = [Book1]Sheet1!Col(2);
	range yValues = [Book1]Sheet1!Col(3);
	index = xValues.GetSize() + 1;
	DataSetIdentifier[index]$ = getpts.data$;
	xValues[index] = $(x,);
	yValues[index] = $(y,);
}

Chris D

428 Posts

Posted - 10/23/2017 :  2:52:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi.

You can access the Y column label rows for the plot being picked/clicked on using the %C string register inside your PointProc. It holds the active plot name.

%C[L]$ is a string representing the value of the long name for the relevant Y column.
%C[ABC]$ is a string representing the value of the user-defined parameter called ABC.

You can ready more about the codes used for label rows here:
http://www.originlab.com/doc/LabTalk/ref/Column-Label-Row-Characters



Thanks,
Chris Drozdowski
Originlab Technical Support

Edited by - Chris D on 10/23/2017 2:53:45 PM
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