
이 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}
... 나는 이것을 얻습니다:
나는 를 사용하고 tikzedt
있으며 그런 종류의 구문을 사용하면 직사각형 노드를 이동할 수 있는 핸들을 제공합니다. 그 안에 플롯 부분을 넣어 노드와 함께 움직이도록 하고 싶습니다.
불행하게도 \draw
plot
충돌이 발생하거나 \x1
작업 \y1
으로 인해 발생하는 경우 let
(예: 에서와 같이 plot ({\x1+\x},{\y1+0.5*exp(-\x)*sin(1000*\x)});
) 완전히 잘못된 결과를 제공합니다.
그렇다면 \draw
plot
내부 를 어떻게 이동할 수 있습니까 (mynode)
? 즉, 명시적인 대신 를 참조하여 위치를 지정하도록 할 수 (mynode)
있습니까?
답변1
글쎄, 그냥 사용할 수도 있었는데 shift
, 더 일찍 기억했으면 좋았을 텐데요:
\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)});