
Mit diesem MWE:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{fit,calc}
\makeatletter
\tikzset{
% http://tex.stackexchange.com/questions/47704/how-to-establish-node-anchor
fitting node/.style={
inner sep=0pt,
fill=none,
draw=none,
reset transform,
fit={(\pgf@pathminx,\pgf@pathminy) (\pgf@pathmaxx,\pgf@pathmaxy)}
},
reset transform/.code={\pgftransformreset},
}
\makeatother
\begin{document}
\begin{tikzpicture}
% 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)});
%*/
\end{tikzpicture}
\end{document}
... bekomme ich Folgendes:
Ich verwende tikzedt
, und mit dieser Art von Syntax erhalte ich Griffe zum Verschieben des rechteckigen Knotens. Ich möchte den Plot-Teil darin haben, sodass er sich zusammen mit dem Knoten bewegt.
Leider gibt der \draw
plot
Absturz völlig falsche Ergebnisse aus, wenn er auftritt \x1
oder \y1
dies aus einer Operation resultieren würde let
(wie z. B. in plot ({\x1+\x},{\y1+0.5*exp(-\x)*sin(1000*\x)});
).
Wie kann ich also das \draw
plot
innerhalb von verschieben (mynode)
(d. h., seine Positionierung in Bezug auf vornehmen (mynode)
, anstatt explizit)?
Antwort1
Nun, ich hätte einfach verwenden können shift
, wünschte, ich hätte früher daran gedacht:
\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)});