0

How can I draw an Argand diagram in LaTeX? If you would like an example of the sort of diagram I'd like to draw in LaTeX here is one a DuckDuckGo search found me: http://physicsforidiots.com/wp/wp-content/uploads/2014/07/5throot6.jpg. The only differences between that and what I want is I want the lines connecting the roots and the origin to be dotted, I would like r and theta not to be shown or labelled and I do not want the colour yellow to appear in the diagram at all. I have seen this related question, Drawing a circle in the complex plane., but it didn't include any information about labelling points on the circle, or connecting them to the origin.

1
  • 1
    What you try so far? Which tools (package) you like to use? At least you should include sketch of desired image in question. The link can become dead after while.
    – Zarko
    Commented Mar 15, 2020 at 12:58

1 Answer 1

1

Here is a simple solution based on pstricks:

\documentclass[border=6pt, svgnames]{standalone}%
\usepackage{sansmath}
\usepackage{pst-eucl}

\begin{document}

\begin{pspicture*}(-3.5,-3)(6.5,3)
\sansmath $ \everypsbox{\scriptstyle}
\psset{dash =2.5pt 2pt}
\psaxes[ticks=none, labels=none](0,0)(-3.5,-3)(6.5,3)
\psline[linecolor=white, linewidth=1pt](0,0)(1.43,0)
\pnode(0,0){O}\psdot(6,0) \uput[d](6,0){6}
\psset{fillstyle=solid}
\pswedge[linestyle=none, fillcolor=Yellow!40](O){1.43}{0}{72}
\pscircle[fillstyle=none](O){1.43}
\multido{\Iangle=0+72,\i=0+1}{5}{\dotnode[dotstyle=o, dotsize=3.5pt, fillcolor=cyan](1.43;\Iangle){A\i}%
\ncline[linestyle=dashed, linewidth=0.5pt, nodesepB=1.5pt]{O}{A\i}}
\pstMarkAngle[linewidth=0.5pt, fillcolor=white, LabelSep=0.55]{A0}{O}{A1}{\theta}
\uput[dr](A0){1.43}
\uput[r](A1){0.44+1.36\mathsf{i}}
\uput[ul](A2){-1.16+0.84\mathsf{i}}
\uput[ul](A3){-1.16-0.84\mathsf{i}}
\uput[dr](A4){0.44-1.36\mathsf{i}}$
\end{pspicture*}

\end{document} 

enter image description here

7
  • Looks great, although unfortunately it doesn't seem to be working for me, I get this error from copying the document part of this code and adding the two package lines to the top of my file and building it: paste2.org/KsJN0L9L. I get the same error when I just straight copy-paste this all into a new .tex file and build it in TexMaker.
    – Josh Pinto
    Commented Mar 15, 2020 at 16:20
  • Are you compiling with pdflatex?
    – Bernard
    Commented Mar 15, 2020 at 16:22
  • I think so; this is at the top of the log file: paste2.org/mkBMsW55.
    – Josh Pinto
    Commented Mar 15, 2020 at 16:23
  • Yes, the preloaded fomat is pdflatex. The are several ways to make it work: the old way follows the latex-dvips-pstopdf path. But you also can compile with xelatex. It can also work with pdflatex if you load the auto-pst-pdf package (after pstricks) and compile with the --enable--write18 option (MiKTeX) or -shell-escape (TeX Live, MacTeX), because pdftex does not have the computing capabilities that are required by postscript, so it has to oursource part of the job. In my opinion,, the simplest is to use xelatex as a standalone file, then use \includegraphics.
    – Bernard
    Commented Mar 15, 2020 at 16:37
  • Seems like even XeLaTeX has significant limitations here, i.imgur.com/HcjUY5B.png.
    – Josh Pinto
    Commented Mar 15, 2020 at 16:41

You must log in to answer this question.

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