pgfplots 仅绘制奇数 3d 段

pgfplots 仅绘制奇数 3d 段

给出如下的三维坐标表:

x1 y1 z1  
x2 y2 z2  
x3 y3 z3  
x4 y4 z4 

我希望用一条\addplot3命令打印从第一个点到第二个点、从第三个点到第四个点等等的段,如下所示:

(x1, y1, z1)->(x2, y2, z2)
(x3, y3, z3)->(x4, y4, z4)

而不是连接点 2 到 3、点 4 到 5 等等的线段。

我怎样才能实现这个目标?

目前我被困住了

目前我被困住了

由该代码给出:

\documentclass[10pt, border=5pt]{standalone}

\usepackage{ifthen}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11,
             height=15cm
             }
\usetikzlibrary{positioning}


\begin{document}
    \begin{tikzpicture}
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        \begin{axis}[
            view={37}{30},
            xlabel = {$x_{lvlh}$ (km)}, ylabel = {$y_{lvlh}$ (km)}, zlabel = {$z_{lvlh}$ (km)},
            unit vector ratio=1 1 1,
            ymin=-0.15, ymax=0.15
            ]%
            \addplot3[
                blue,
            ]
            table [x={x1}, y={x2}, z={x3}] {statex.dat};

            \addplot3+[
                mark=*,
                black,
                mark size=0.85,
                error bars/y dir=plus,
            ]
            table [x={u1}, y={u2}, z={u3}] {u.dat};

        \end{axis}
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \end{tikzpicture}%

    \end{document}

相关内容