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
 Exchanging X-Data in Graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

siggi4

Germany
2 Posts

Posted - 01/21/2021 :  12:54:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear Origin-Forum,

i hope you can help me with the following problem:

The Situation:
I have a large set of data, that I organized into worksheets. Every worksheet has several x-columns and y-columns (lets simplify: X1 X2 Y Y Y). Each set of y-columns (Y Y Y) is scientifically linked to each x-column (e.g. X1). To get an overview i plottet every worksheet so that i have a graph that shows (X1 YYY) in one layer.

My Wish:
I would like to be able to exchange the x-Data in the graphs (which leads to a more accurate picture)(eg. exchange X1 so that the graph shows X2 YYY). This can be done via the UI (Graph --> Diagram Setup --> choose other x and propagate the changes into the same graph).
Since I got 500 graphs that I want to apply the change to I need some quicker way to do this than the UI. Thats why I came to OriginC as a possible solution. Only that I don't seem to find the correct documentation to solve my problem.

What I get from the documentation I found (https://www.originlab.com/doc/OriginC/guide/Graphs and the links there) is that I probably need to work with dr.add()-Funktion. For the beginning a simple proof of concept would be nice. My logical steps would be:
1. Choose a graph window that needs changing
2. Use a Function to load the active graph window
3. Pick the range of Data in this graph
4. Identify the chosen X-Column (via User-Defined Parameter)
5. Pick a new X-Column (Depending on user input)
6. Exchange the Data-Points (either by exchanging the X-Link or by drawing a new XY-Pair and deleting the old one

I hope you can help me with this seemingly easy and still impossible task.

Best regards
Simon


Origin Ver. and Service Release (Select Help-->About Origin): Origin 2020 (64-bit) SR1
Operating System: Win10 64-bit up to date

Edited by - siggi4 on 01/21/2021 12:55:02 PM

一击爆裂陈子豪

Taiwan
41 Posts

Posted - 01/25/2021 :  09:26:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Normally I'll just delete the previous plot from he layer and add a new one.
Go to Top of Page

couturier

France
291 Posts

Posted - 02/01/2021 :  03:21:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
see DataPlot::ChangeData
Go to Top of Page

siggi4

Germany
2 Posts

Posted - 02/24/2021 :  05:18:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the answers :)
I got it working with a messy custom code in the meantime. I'll keep "changedata" in mind. That was what I was looking for but could not find. Now I got my own :D

Best regards
Simon
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