Example: Degree wheel

Published 2008-09-24 | Author: Dario Orescanin

A degree wheel inspired by an example on the PSTricks website.

Download as: [PDF] [TEX]

Degree wheel

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.

% A simple compass
% Author: Dario Orescanin



% Define a few constants for easy configuration


  % adding a subtle gray tone to add a bit of "personality"
  \shade[shading=radial, inner color=white, outer color=gray!15] (0,0) circle (\radius);

  \draw (0,0) circle (\radius);
  \draw[fill=black] (0,0) circle (.02mm);
  \node[draw, circle, inner sep=.2mm] (a) at (0,0) {};

  % helper lines
  \foreach \x in {0, 45, ..., 360} \draw[very thin, gray!40] (a) -- (\x:\radius);

  % main lines
  \foreach \x in {0,...,359} \draw (\x:\onedegrad) -- (\x:\radius);

  % labels and longer lines at every 10 degrees
  \foreach \x in {0,10,...,350}
    \node[scale=1.4, rotate=\x*-1] at (360-\x+90:\labelrad) {\x};
    \draw (\x:\tendegrad) -- (\x:\radius);

  % lines at every 5 degrees
  \foreach \x in {0,5,...,355}  \draw (\x:\fivedegrad) -- (\x:\radius);




  • #1 Kjell Magne Fauske, October 20, 2008 at 10:06 p.m.

    This example triggered the discovery of an inaccuracy in the way PGF draws circles. You can read the full details on the pgf-users mailing list. This issue has been fixed in the current CVS version of PGF. You can grab a recent build from the builds section.

Adding comments is currently not enabled.