# pstricks spiral with labels

I am trying to recreate the following spiral graphic using pstricks:

which should look like

My first thought was to use a logarithmic function like in this post. But then I wouldn't know how to add the labels.

Another thougt would be to use \pscurve. Maybe someone knows how I can find out the points of the graphic to use that function.

• Welcome to TeX SX! Your question is not clear: is it supposed to be a helix (i.e. a skew curve in $3$-space) or a spiral ( a plane curve, usually defined by a polar equation, like Archimedes' spiral)? Jan 19, 2018 at 19:43
• @Bernard Thanks for your suggestion to make the question more clear. I added a picture which hopefully shows my intention Jan 19, 2018 at 19:56
• Suggestion: Rephrase your title using spiral instead of helix. Jan 19, 2018 at 21:37

A small variant, with Archimedes' spiral:

\documentclass[a4paper, pdf, svgnames]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[f]{esvect}
\pagestyle{empty}

\usepackage{auto-pst-pdf} %% to compile with pdflatex --enable-write18 (MiKTeX) or pdflatex --shell-escape (TeX Live, MacTeX)

\begin{document}

\begin{pspicture}
\psset{plotpoints=200, labelsep=1ex}
\everypsbox{\sffamily}
\psplot[polarplot, arrows=*-, linecolor=Tomato, linewidth=1.2pt, dotsize=2.5pt,]{0}{440}{x 100 div}
\multido{\i = 180 + 40, \n = 1.8 + 0.4}{7}{\uput[\i](\n; \i){A\i}}
\end{pspicture}

\end{document}


• Thank you for that answer. I guess that is the easier and cleaner way of creating a spiral. Therefore I accepted your answer as the "best" one. Jan 19, 2018 at 23:06
• There's just a problem: I tried a logarithmic spiral, but it didn't work (I can plot functions with logarithms, but strangely it doesn't work for polar plots). Any way, the way the curves begin are not very different, but I think I'll have to post a question. Jan 19, 2018 at 23:24
\documentclass[pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-4,-4)(5,5)
\psparametricplot[linecolor=red,linewidth=2pt,plotpoints=1000]{0}{-510}%
{t sin t DegtoRad 2 div mul t cos t DegtoRad 2 div mul }
\multido{\iA=180+40,\rA=-3.14+-0.698}{7}{%
\rput*(! \rA\space neg dup RadtoDeg cos 1.5 div mul
\rA\space dup RadtoDeg sin 1.6 div mul){A$\iA$}}%
\end{pspicture}
\end{document}


• That looks perfect for my purpose! Thanks alot! Jan 19, 2018 at 23:05

Since some nice PStricks answers have already be posted, as requested by the OP, I felt free to post the same kind of figure, this time with MetaPost, for whom it may interest. Code included in a LuaLaTeX program thanks to the luamplib package.

\documentclass[12pt, border=3mm]{standalone}
\usepackage{luatex85, luamplib}
\mplibsetformat{metafun}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
u := cm;
path spirale;
beginfig(1);
spirale = origin
for t = 1 upto 420:
hide(pair currentpoint; currentpoint = u*t/90*dir t;
if (t >= 180) and ((t-180) mod 40 = 0):
freelabel("A" & decimal t, currentpoint, origin); fi)
.. currentpoint
endfor;
draw spirale withcolor red;
endfig;
\end{mplibcode}
\end{document}