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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Get Dataset name from plot with getpts

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
SFackler Posted - 10/23/2017 : 11:17:57 AM
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,);
}

1   L A T E S T    R E P L I E S    (Newest First)
Chris D Posted - 10/23/2017 : 2:52:57 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000