3D プロット内の複数の 2D ガウス楕円

3D プロット内の複数の 2D ガウス楕円

3D空間の異なる点に、異なる2変量ガウス分布を2D楕円でプロットしたいと思います。Jakeが提案しているように、2D楕円をプロットします。tikz を使用したガウス楕円体しかし、技術的にはすでに 3D プロットです。この方法を拡張する可能性はありますか?


私は次の例を思いつきました(左:楕円の向きの例、以下から抜粋)https://arxiv.org/abs/1611.03986、右:私の仮説):

ここに画像の説明を入力してください上記の.texファイルの出力

2つの主なポイントは

  • カラーマップは実際には透明ではなく、外部座標系の軸は見えません。
  • そして、楕円を固定点に配置したいのですええの中にxz-平面(つまり、黒い長方形の下の線がバツ-軸に沿って圧縮されます。
\documentclass{standalone}
\usepackage{tikz,pgfplots}
\usepgfplotslibrary{patchplots}
\pgfplotsset{%
    colormap={whitered}{color(0cm)=(transparent); color(1.cm)=(red)}%
}
\begin{document}
\begin{tikzpicture}[baseline,
    declare function={bivar(\ma,\sa,\mb,\sb)=
        1/(2*pi*\sa*\sb) * exp(-((x-\ma)^2/\sa^2 + (y-\mb)^2/\sb^2))/2;}]
% Outer coordinate system
\begin{axis}[
    unit vector ratio*=1 1 1,
    axis lines = middle,
    view={120}{30},
    domain = -10:10,
    zmin = -5, zmax = 5,
    xlabel = $x$, ylabel = $y$, zlabel = $z$,
    x label style={at={(ticklabel* cs:1.)},anchor=north east},
    y label style={at={(ticklabel* cs:1.)},anchor=north west},
    z label style={at={(ticklabel* cs:1.)},anchor=south},
    ]
    \coordinate (origin1) at (axis cs:0,-10,0);
    \coordinate (origin2) at (axis cs:0,10,0);
    \addplot3[no markers,opacity=0]{0}; % <- without this pseudo plot, the outer coordinate system does not work
\end{axis}
% Bivariate distribution 1
\begin{axis}[
    at={(origin1)}, anchor={center},
    width=3cm, height=3cm,
    scale only axis,
    axis equal image,
    hide axis,
    colormap name=whitered,
    view={0}{90},
    enlargelimits=false,
    domain=-1.5:1.5, y domain=-1.5:1.5,
    ]
    \addplot3 [surf, draw=none, samples=19, shader=interp, patch type=bilinear] {bivar(0,.1,0,.6)};
\end{axis}
% Bivariate distribution 2
\begin{axis}[
    at={(origin2)}, anchor={center},
    width=3cm, height=3cm,
    scale only axis,
    axis equal image,
    hide axis,
    colormap name=whitered,
    view={0}{90},
    enlargelimits=false,
    domain=-1.5:1.5, y domain=-1.5:1.5,
    ]
    \addplot3 [surf, draw=none, samples=19, shader=interp, patch type=bilinear] {bivar(0,.2,0,.3)};
\end{axis}
\end{tikzpicture}
\end{document}

関連情報