With this MWE:

  % http://tex.stackexchange.com/questions/47704/how-to-establish-node-anchor
  fitting node/.style={
    inner sep=0pt,
    reset transform,
    fit={(\pgf@pathminx,\pgf@pathminy) (\pgf@pathmaxx,\pgf@pathmaxy)}
  reset transform/.code={\pgftransformreset},

% separately plot and box, else tikzedt don't show handles
\draw [black,thick] (1,3) rectangle (3.5,4)
  node[fitting node] (mynode) {};
%/* % also make tikzedt ignore (do not parse) this, plot kills all handles
\draw let \p1=(mynode) in
  [black, thick, domain=0:2.5,samples=50]
  plot (\x,{0.5*exp(-\x)*sin(1000*\x)});

... I get this:


I'm using tikzedt, and with that kind of syntax, it gives me handles to move the rectangle node around; I'd like to have the plot part inside it, so it moves along with the node.

Unfortunately, the \draw plot crashes gives entirely wrong results if it encounters \x1 or \y1 which would result from a let operation (e.g. as in plot ({\x1+\x},{\y1+0.5*exp(-\x)*sin(1000*\x)});).

So, how can I move the \draw plot inside the (mynode) (that is, make it's positioning in reference to (mynode), instead of explicit)?


Well, could have just used shift, wish I remembered earlier:

\draw let \p1=(mynode.west) in
  [black, thick, domain=0:2.5,samples=50,shift=(\p1)]
  plot ({\x},{0.5*exp(-\x)*sin(1000*\x)});


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.