
이 특정 다이어그램에 대한 솔루션 외에도 설명할 수 있습니까?만약 있다면이 코드를 얻기 위해 따라야 할 일반적인 단계는 무엇입니까?
내 추측:벡터 그래픽으로 변환하면 몇 가지 지침이 제공됩니까?
자동화할 수 있는 프로세스 부분이 있습니까? 등.
나는 시도했다:Inkscape를 사용하여 벡터 그래픽으로 변환하고 어떻게든 tikz 코드에 대한 지침으로 사용할 수 있는 여러 좌표를 얻습니다.
나는 지금까지 다음을 얻었습니다.이 답변):
\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{decorations.text}
\pgfmathdeclarefunction{gauss}{3}{%
\pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}%
}
\begin{document}
\begin{tikzpicture}
\draw[draw=none](0,4)--node[anchor=center, above] (A) {Marginal
distribution of Brownian motion through time} (10,4) ;
\draw[->,very thick](0,0)--(0,4) node[anchor=south, above left,
rotate=90] {Spacial distribution};
\draw[->,very thick](0,0)-- node[anchor=north, below] {Time} (10,0);
\draw[dotted, domain=0:9,samples=35,thick] plot ({\x+0.5},
{sqrt(\x)/2+2});
\draw[dotted, domain=0:9,samples=35, thick, smooth, postaction=
{decorate, decoration={raise=-10pt, text along path,text
align=center,text={Spread of Willow Tree}}}] plot ({\x+0.5},
{-sqrt(\x)/2+2});
\draw[very thin, domain=-0.5:2.5,samples=35] plot({gauss(\x, 1, 1)+1},
{\x+1}) node (B) {};
\draw[very thin, domain=-0.5:2.5,samples=35] plot({gauss(\x, 1, 0.5)+3},
{\x+1}) node (C) {};
\draw[very thin, domain=-0.5:2.5,samples=35] plot({gauss(\x, 1, 0.25)+5},
{\x+1}) node (D) {};
\draw[very thin, domain=-0.5:2.5,samples=35] plot({gauss(\x, 1, 0.2)+7},
{\x+1}) node (E) {};
\draw[->] (A) to (B);
\draw[->] (A) to (C);
\draw[->] (A) to (D);
\draw[->] (A) to (E);
\end{tikzpicture}
\end{document}
이는 다음을 생성합니다.
답변1
올바른 방향을 가리켜야 하는데...
\documentclass[tikz, border=5]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth, line cap=round]
\draw [thick, ->] (0,-2) -- (0, 2)
node [midway, sloped, above] {Spatial distribution};
\draw [thick, ->] (0,-2) -- (10,-2)
node [midway, below] {Time};
\draw [thick, dotted]
plot [domain=-1.5:1.5, samples=50] ({(\x*2)^2+.5},\x)
node [right, align=center] {Spread of \\ willow tree};
\foreach \t [count=\i] in {.1,0.5,1,1.5}
\draw plot [domain=-3:3, samples=20, smooth]
({\i*2 + sqrt(0.5*\t*pi)*exp(-0.5*\t*pow(\x,2))}, \x/2)
coordinate (distribution-\i);
\node [above] (label) at (5,2)
{Marginal distribution of Brownian motion through time};
\foreach \i in {1,...,4}
\draw [->, shorten >=1ex] (label) -- (distribution-\i);
\end{tikzpicture}
\end{document}
답변2
접근 방식 은 다음과 같습니다 pgfplots
.
\documentclass[tikz,border=10pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{decorations.text}
\pgfmathdeclarefunction{gauss}{3}{%
\pgfmathparse{1/(#3*sqrt(2*pi))*exp(-((#1-#2)^2)/(2*#3^2))}%
}
\begin{document}
\begin{tikzpicture}
\begin{scope}[rotate=-90]
\begin{axis}[
domain=-0.5:2.5,
xmin=-1, xmax=3,
ymin=0, ymax=10,
xlabel=Spacial distribution, ylabel=Time,
xtick=\empty, ytick=\empty,
axis x line=bottom, axis y line=right,
x axis line style = {very thick,stealth-},
y axis line style = {very thick},
height=\textwidth,
width=.5\textwidth,
clip=false]
\addplot[mark=none, thick, dotted,
postaction={decorate, decoration={raise=-10pt, text along path,
text align={right, right indent=3.5cm},text={|\scriptsize|Spread of Willow Tree}}}]
{((x-1)*2)^2+.5};
\node [xshift=-1cm,rotate=90] (label) at (current bounding box.west)
{Marginal distribution of Brownian motion through time};
\foreach \t/\i in {1/1, 0.5/3, 0.25/5, 0.2/7} {
\addplot[samples=35,smooth] {gauss(x, 1, \t)+\i};
\edef\temp{
\noexpand\coordinate (g-\i) at (axis cs:-0.5,\i);
\noexpand\draw [->, shorten >=2ex] (label) -- (g-\i);}
\temp
}
\end{axis}
\end{scope}
\end{tikzpicture}
\end{document}