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
 Labtalk and changing x-axis titles
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 12/20/2012 :  10:01:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 9.0.0 (Student Version), Win7 64-bit, running in VMware Fusion 5.0.2

I would like, using LabTalk (w/o having to resort to a UI dialog intervention in the middle of the script), to change the X-axis title for a given layer. BUT only if there is an axis title object for the layer (e.g. it didn't get manually deleted from the layer or the title is set to display via the "Show Axis & Ticks" setting of the Format Axis dialog).

Let me explain. I have a number of graph templates from which I can create graphs. They all have the x-axis in wavelength and some even have multiple layers. I am writing a script to convert the x-axes to wavenumber. I've got it all done except for dealing with the title(s) for the x-axes.

My script, as it converts the x-axes, needs to change the axis title. But some graph templates (or layers therein) may not have x-axis titles to begin with.

Is it possible to check for the existence or diaplay of the x-axis title for graph layers?


Is this possible?

cdrozdowski111

USA
247 Posts

Posted - 12/21/2012 :  07:51:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I found a partial solution- detecting whether an existing X-axis title is visible or not. I cannot find a way to determine if there is actually a title object or not.

I though I'd share it in case someone else ever searches for it.

// Change x-axis title and respect it's visibility
int nXBShow = XB.show;

XB.text$ = "New Title";

if ($(nXBShow) == 0)
{
XB.show = 0;
}
Go to Top of Page

greg

USA
1378 Posts

Posted - 12/21/2012 :  2:59:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This logic should cover it:

if(XB.X!=NANUM)
{
if(XB.SHOW == 0)
ty XB exists and is hidden;
else
ty XB exists and is visible;
}
else
ty XB does not exist;
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