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
 Plotting a range of values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Lou435

2 Posts

Posted - 02/14/2019 :  07:12:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.2019: Operating System: Win7

I want to plot a xy diagram from a 3 column sheet. The third column is only needed to determine the range I want to plot.
Let's assume the third column goes from -10 to +10. I only need all values between -5 and +5. But instead of plotting this range of column 3, I want to plot the same range of column 2 (however the range here is not based on values, but on equivalent positions to column 3).

Has anyone an idea how to solve this? Column 2 is changing for every new data set, so it cannot be used for defining a range.

For a scheme:
x y1 y2
0,1 2 -10
0,2 4 -9
0,3 6 -8
0,4 8 -7
0,5 10 -6
------------------ I want to plot x vs y1 from y2:-5/5
0,6 12 -5
0,7 14 -4
0,8 16 -3
0,9 18 -2
1,0 20 -1
1,1 22 0
1,2 24 1
1,3 26 2
1,4 28 3
1,5 30 4
1,6 32 5
-------------------
1,7 34 6
1,8 36 7
1,9 38 8
2,0 40 9
2,1 42 10

Chris D

428 Posts

Posted - 02/14/2019 :  11:26:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may try this little snippet:


int nstart = -5;
int nend = 5;
plotxy iy:=col(2)[index(nstart, col(3)):index(nend, col(3))];


You would simply change the valuer of nstart and nend as you need to.

If that range string doesn't work for the type of plot you are using let me know.


Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Lou435

2 Posts

Posted - 02/15/2019 :  07:51:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This gives an error: "variable not defined:nend"

Can I say start from values bigger than -5 and end with values smaller than +5?
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