11

Pasted below is a helix created with PGFPlots package and now I need to add points to a helix. What I was able to get so far is pasted below. I also included a figure depicting desired output I created in Matlab [code].

\documentclass{minimal}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3+[domain=0:6*pi, samples=100, samples y=0,no marks, smooth](
  {cos(deg(x))},
  {sin(deg(x))},
  {x/(3*pi)}
);
\end{axis}
\end{tikzpicture}
\end{document}

PGFPlots example: enter image description here

Matlab output: enter image description here

0

1 Answer 1

13

You can add nodes just as you put nodes on the lines in a TikZ drawing as below or you can give 3D coordinates with an additional \addplot3 command.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3+[domain=0:4*pi, samples=100, samples y=0,no marks, smooth](
  {cos(deg(x))},
  {sin(deg(x))},
  {x/(3*pi)}
) node[blue,circle,fill,pos=0.3]{} node[red,draw,pos=0.65,thick]{};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .