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
 Origin Forum
 axis manipulation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

studentAgain

8 Posts

Posted - 05/04/2012 :  7:35:22 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 7.5/8.5
Operating System: XP

Hello,

I would like to ask a quick question about axis manipulation: is there a quick way to subtract a common number from the X axis? (I have a lot of data plotted in one graph and it would be great if I do not need to go through every single x column of my data and do it manually)
Similar to the option available in the "Tick Labels" 'divide by factor' by I just need to subtract the number?

Thank you very much in advance,
Student

easwar

USA
1964 Posts

Posted - 05/06/2012 :  5:10:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Student,

There is no gui control for this, but you could run some script such as below.

This script will find the X dataset of each plot in the active layer, and subtract 10 from the x values. So if your graph has X, Y from different datasets plotted in a layer, it will operate on each of them. Note that this operates on the active layer, so if you have more than one layer you need to run it on each layer, or you can look up LabTalk User Guide to learn how to loop over all graphs, then all layers, and run this code for each layer that is found.


// Loop over all data plots in current layer
doc -e D{
	// Get current plot index
	int nplot = layer.plot;
	// Get the worksheet range of the corresponding X-values: 
	range -wx rWx = $(nplot);
	// Subtract offset from the X-values
	rWx -= 10;
	}
}


Easwar
OriginLab



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