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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 display problems

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
anje18 Posted - 07/18/2002 : 08:40:43 AM
When I create a line graph I need to be able to quickly change the scale so I can scan over the graph horizontally without much problem. What is the easiest way to create such a function. I have seen it done in an origin test file.
5   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 07/22/2002 : 3:58:33 PM
Hi,

I stand corrected! You can access the x and y scale limits from Origin C in 7SR1. The following code scrolls the x axis by a percentage. Make a graph layer active and call from script window:
scrollx 10
to scroll x by 10% to right, and
scrollx -10
to scroll x by 10% left



void scrollx(int iscroll)
{
// scroll x axis by iscroll%
GraphLayer gl = Project.ActiveLayer();
if(!gl)
{
out_str("not a valid graph layer!");
return;
}
double xlow = gl.X.From;
double xhigh = gl.X.To;
gl.X.From = xlow + (xhigh - xlow) * iscroll / 100.;
gl.X.To = xhigh + (xhigh - xlow) * iscroll / 100.;
}


Easwar
OriginLab.
Mike Buess Posted - 07/22/2002 : 3:56:05 PM
Additionally, you can fix your macro by omitting the () in the definition:

def Scroll {
  getn (left margin) X1 (right margin) X2 (Enter X axis margins);
}

PS... I think Easwar meant to use LT_set_var rather than LT_get_var in his OriginC function.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/22/2002 3:59:08 PM

Edited by - Mike Buess on 07/22/2002 4:00:14 PM
easwar Posted - 07/22/2002 : 3:04:14 PM
Hi,

Looks like you want access to getting and setting the axis limits from Origin C. This functionality is being added to Origin C and should be available in the next service release. In the mean time, you can call LabTalk from within Origin C with code like below:


void scroll()
{
double x1, x2;
// Call LabTalk to bring up dialog, get and set axis limits
LT_execute("getn (left margin) X1 (right margin) X2 (Enter X axis margins)");
// Get LabTalk variables into Origin C variables
LT_get_var("X1", &x1);
LT_get_var("X2", &x2);
printf("%f %f\n", x1, x2);
}


Easwar
OriginLab.

Edited by - easwar on 07/22/2002 3:05:53 PM
anje18 Posted - 07/22/2002 : 2:37:01 PM
Thank you for the function but I am receiving the following error:

C:\Program Files\OriginLab\OriginPro7\OriginC\Scroll.c(28) :Error, syntax error in variable declaration.

when entering the following command into LabTalk:

def Scroll() {
getn (left margin) X1 (right margin) X2 (Enter X axis margins);

}
Could you possibly tell me why I am running into errors with this? Thanks.
Mike Buess Posted - 07/18/2002 : 4:01:17 PM
You can easily do that in LabTalk by assigning the following command to a macro or button...

getn (left margin) X1 (right margin) X2 (Enter X axis margins);

You can similarly adjust the Y scale... just replace all X with Y.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000