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
 Origin Forum
 Stretching/compressing curve relative to anchor

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
MMEC Posted - 07/15/2016 : 11:26:50 AM
Hi,

I was wondering if it were possible to stretch and/or compress a 2D curve relative to a fixed anchor point in Orgin 2016? I'm hoping to stretch/compress the curve in question along the x-axis.

Thanks!
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 07/15/2016 : 2:29:12 PM
Hi MMEC,

If you want to stretch the plot in terms of scale-in or out, you can press Z key, and rotate the mouse wheel.

If you want to change the X values themselves with a factor, similar to the horizontal translation,
there is currently no built-in tool for that, but script like following does such kind of task.
///////////////////////////////////////////////////
clicks=0;
dotool 2; //select tool 2=Screen Reader, 3=Data Reader
type -b Double-click the anchor point twice;
def pointproc {
  clicks++;
  if(clicks<2) type -b Click next anchor point please;
  xx$(clicks)=X;  //x coordinate
  yy$(clicks)=Y;  //y coordinate
  yds$=%C;  //y dataset of the curve
  if(clicks>=2) {
    %A=xof(%C);  //x dataset of the curve
    xbk$=token(%A,1,'_')$;  //book name
    xds$=token(%A,2,'_')$;  //column name
    range rx=[%(xbk$)]1!col(%(xds$)); //x range
    xf=xx2/xx1;  //factor
    rx=rx*xf;
    type -b  factor:$(xf,.2) point1:($(xx1,.2), $(yy1,.2)), point2:($(xx2,.2), $(yy2,.2));
    dotool 0;  //Return to the Arrow tool
  }
}
///////////////////////////////////////////////////


Please try and modify whatever you want.

--Hideo Fujii
OriginLab

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