# Complex and real axis in LaTeX - graphing

Can somebody help me to make such an illustration in LaTeX, then I would be very happy! I'm new to LaTeX, but I am trying to learn how to graph different things. I tried using another code I saw in here as a base, but it really didn't seem to be working - hope that anybody can help me then!

• E.g. \documentclass[tikz,border=3mm]{standalone} \begin{document} \begin{tikzpicture}[>=stealth,thick] \draw[->] (-0.2,0) -- (2.5,0) node[right]{Re}; \draw[->] (0,-0.2) -- (0,3) node[above]{Im}; \draw[->,blue!80!black] (0,0) -- (60:2.5) node[fill,circle,inner sep=2pt,label=above right:$a+\mathrm{i}\,b$] (z) {} ; \draw[dashed] (0,0|-z) node[left]{$b$}-- (z) (0,0-|z) node[below]{$a$}-- (z); \end{tikzpicture} \end{document}.
– user194703
Mar 23 '20 at 19:38
• Apart from a direct and detailed solution, a step-by-step tutorial may also help. The first tutorial in doc of tikz, sec. 2 is a such one. Mar 23 '20 at 20:09

## 2 Answers

Here is a short code with pstricks:

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

\begin{document}

\begin{pspicture*}(-1,-1)(4,4)
\psset{arrowinset=0.15, linejoin, arrows=->}
\psaxes[ticks=none, labels=none, labelsep=0.3em](0,0)(-1,-1)(3,3.5)[\text{Re},0][\text{Im},90]
\pstGeonode[PointName=0, PosAngle=-135, PointSymbol=none](0; 0){O}
\psCoordinates[linestyle=dashed, arrows=-,dotscale=0.1](2,2.5)
\uput[d](2,0){$a$}\uput[l](0,2.5){$b$}
\psset{linecolor=CornflowerBlue, linewidth=1.5pt}
\pstGeonode[PointName=a{+}bi, PosAngle=75, PointNameSep=0.8em](2,2.5){Z}
\ncline{O}{Z}%
\end{pspicture*}

\end{document}


Here is an even shorter code with tikz from the above comment, which can be compiled with any of the standard compiler (pdflatex, xelatex, lualatex) without any special preparations or switches. To have a partial overlap of the arrow with the dot, use shorten with a negative distance.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth,thick]
\draw[->] (-0.2,0) -- (2.5,0) node[right]{Re};
\draw[->] (0,-0.2) -- (0,3) node[above]{Im};
\draw[->,blue!80,shorten >=-1pt]
(60:2.5) node[fill,circle,inner sep=2pt,outer sep=0pt,label=above right:$a+\mathrm{i}\,b$]
(z) {} (0,0) --(z);
\draw[dashed] (0,0|-z) node[left]{$b$}-- (z)
(0,0-|z) node[below]{$a$}-- (z);
\end{tikzpicture}
\end{document}


Like many others, I prefer to typeset the imaginary i upright to make it distinguishable from an index i.