How can make the axis lines that go from the origin to each of the coordinates dashed? For instance I want the axis line that goes from (0,0,0) to (0,0,1) to be dashed.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}[scale=1]
\begin{axis}[view={40}{20}, ticks = none, axis on top, axis lines=center, y
dir=reverse, ymin=0, ymax=2, xmin=0, xmax=2, zmin=0, zmax=2,
xlabel=$p_{1}$, ylabel=$p_{2}$, zlabel=$p_{3}$, every axis y label/.append
style={at=(ticklabel* cs:0)}]
\addplot3[thick,mark=*] coordinates {(1,0,0) (0,1,0) (0,0,1)} --cycle;
\node [above right] at (axis cs:1,0,0) {$(1,0,0)$};
\node [above left] at (axis cs:0,1,0) {$(0,1,0)$};
\node [above right] at (axis cs:0,0,1) {$(0,0,1)$};
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
Perhaps my approach is too simplistic- draw a
dashed white
line on top of the axis for the relevant parts usingYou need to comment out
axis on top,
for this to work.If you look closely, you'll see that the
axis
are still present. This might be a good or a bad thing.... If you don't want to see them at all, addthick
to thedraw
commands: