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
 Unique function / text in Datasets /plot-managemet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Karsten8

Germany
26 Posts

Posted - 02/17/2022 :  04:57:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 2019 9.6.172
Operating System:win10

Hello,

I have some problems handling text/numbers in a dataset as well as using the unique-function in labtalk. A recommendation to handle graph-dataset changes would be great.

#1/ unique function:
I tried the code from: https://www.originlab.com/doc/LabTalk/ref/Unique-func
In the text-column A the cells have: 1,10,3,A,B,1,A inside for testing.
Code from webpage:
StringArray sa;
sa = unique(col(a)); // assign unique values in col(a) to stringArray sa, sort in ascending order
range bb=col(b);
sa.CopyTo(bb); // copy contents of stringArray sa to col(b)

The code does not work – i.e. it seems the transfer from the unique function to the stringarray has problems because if one directly writes “col(b)=unique(col(a));” it works. There is no error message and on the webpage I see no limitation of this function to a special origin-version.

#2/ Some questions to dataset/stringarray:
The dataset with –a option should be able to accept numbers and text:
dataset -a test={1,2,A,B,A}; (A or “A” makes no difference)
but
test[1]$= shows correctly the 1
but
test[3]$= shows only –-

I can’t transfer text to the dataset –a. What point do I miss working with the dataset –a with text?

#3/ how can I transfer text/numbers between datasets and stringarrays?
Since I am stuck using dataset –a with text I could not test it yet but would this work?

Stringarray arr;
Dataset –a dat = col(a);
Arr.append(dat); // move text/numbers from dataset to array

Dataset –a sec;
sec=arr; // move text/numbers from array to dataset


#4/ How to switch on/off data in plots

Using the search function I could not find a similar topic.

I have several datasets from experiment-variations inside my project. The different data from e.g. expA and expB … are stored in different worksheets. Currently I add them to predefined graphs (>15 plots) when I load the data to the project. Later I only want to see the plots from data e.g. expA and expD but not all other data inside the project. What would be a good solution to switch on/off the data inside the plots without having to activate every graph by hand?
Later on I want to compare other data so the changes must be reversible.

Currently my approach is to work with a “archive” worksheet where I store the name of the worksheetname=experiment-name in the first column and in a second column I can write an “x” or not depending on whether I want to see the data inside the plot. A script then checks whether there is an x or not and switches on/off the data inside the graphs (the row-number of the data inside the archive is the same as their row-position in the plot-data-definition).

Is there an easier way? Origin has so many options/functions sometimes it is difficult to find already available solutions.

Thanks for your help.

Best regards,
Karsten8.

YimingChen

1666 Posts

Posted - 02/17/2022 :  4:14:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
#1 - #3
#1 is fixed in the latest version. Yes the dataset -a is not working properly and we will look into it. Can you use StringArray for now? e.g.

StringArray sa = {1,2,A,B,A};
sa.copyto(Col(A));


#4
Can you highlight the data in the worksheet and click the Mask Range icon at the bottom toolbar. Then activate one graph, and click the Hide/Show masked points icon at the bottom toolbar. This is global setting and hide the masked points for all graphs in the project. See if it works for you.


James
Go to Top of Page

Karsten8

Germany
26 Posts

Posted - 02/18/2022 :  02:41:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear James,

thanks for your help. The masking option sounds very useful.

Best regards,
Karsten8.

*closed topic.
Go to Top of Page

celalsur

Algeria
1 Posts

Posted - 03/03/2022 :  06:38:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for share.
Go to Top of Page

YimingChen

1666 Posts

Posted - 05/13/2022 :  10:48:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Just let you know that the bug you reported regarding dataset -a has been fixed in our recently released Origin 2022b. You can upgrade your Origin to test. Thank you.

Yiming
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