Example: Polar coordinates template

Published 2009-12-15 | Author: Zoran Nikolic

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Polar coordinates template

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

%POLAR COORDINATES
%The print template for A4 paper (portrait)
%Author: Zoran Nikolic
\documentclass[12pt]{article}
\usepackage[margin=0.5in,paper=a4paper]{geometry} %Shrinking margins to 0.5in
\usepackage[x11names]{xcolor}                     %Additional colors
\usepackage{tikz}
\usepackage{euler}                                %Nicer numbers

%Note about the colors: 
%  The color of the "ray" lines should not be
%  black or gray as on some printers, significant
%  aliasing distorsion becomes visible.

\begin{document}
\thispagestyle{empty} %Please, no page numbers or similar

\begin{center}
  \begin{tikzpicture}
    %Circles 
    \foreach \r in {1, 2,...,7}
      \draw[SteelBlue3, thick] (0,0) circle (\r);    
    \foreach \r in {0.5, 1.5,...,7}
      \draw[Azure4, thin] (0,0) circle (\r);
    %1° Rays
    \foreach \a in {0, 1,...,359}
      \draw[Azure4] (\a:7.7) -- (\a:8);
    %5° Rays
    \foreach \a in {0, 5,...,359}
      \draw[Azure4] (\a:7.5) -- (\a:8);      
    %15° Rays
    \foreach \a in {0, 15,...,359}
      \draw[thick,Azure4] (\a:1) -- (\a:8); 
    %30° Rays
    \foreach \a in {0, 30,...,359}
      \draw[thick,Azure4] (0, 0) -- (\a:8);
    %Radius labels (background filled white)
    \foreach \r in {1, 2,...,7}
      \draw (\r,0) node[inner sep=1pt,below=3pt,rectangle,fill=white] {$\r$};
    %Main rays
    \foreach \a in {0, 90,...,359}
      \draw[very thick] (0, 0) -- (\a:8);
    %Angle labels  
    \foreach \a in {0, 15,...,359}
      \draw (\a: 8.5) node {$\a^\circ$};
    %Central point
    \draw[fill=red] (0,0) circle(0.7mm);
  \end{tikzpicture}
\end{center}

\end{document}

Comments

  • #1 michele, December 15, 2009 at 11:59 p.m.

    Beautifull!!

  • #2 Andre, December 19, 2009 at 12:22 p.m.

    And so simple!

  • #3 Thiago, December 22, 2009 at 1:18 p.m.

    And so useful!

  • #4 Alex, December 23, 2009 at 7:09 a.m.

    Why are there two separate loops for the 15 and 30 degrees lines? The 15 degree loop paints the 30 degrees also.

  • #5 Thiago, December 23, 2009 at noon

    Maybe because the length?! The 30 degrees lines are longer!

  • #6 Zoran, December 24, 2009 at 10:05 a.m.

    Hi Alex, as Tiago explained, 30es are longer. Still, one could optimize it and start drawing 15 degrees lines at 15 instead of 0 degrees and then advance them in 30 degrees steps so they do not overlap (it would optimize the drawing speed a bit). It just did not cross my mind. You made a good point here.

Adding comments is currently not enabled.

Features
Tags
Scientific and technical areas

Cookbook

LaTeX Beginners Guide

Limited discount 50%
coupon code tDRet6Y

Creative Commons License