# How to inverse top and bottom ?

I would like to get 100 "above" the radius, if I consider that the radius comes from the center towards the circle. A little example :

\documentclass[landscape]{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \a in {0,20,...,340}{%
\draw (0,0)--(\a:4cm) node [pos=.75,above,sloped] {$\a$};
}
\end{tikzpicture}
\end{document}


Another example :

    \documentclass[landscape]{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[color=blue]
\node (A) at (2,-4){A};
\node (O) at (0,0){O};
\node (B) at (-2,-4){B};
\draw[color=red] (O)  to node[sloped,above]{label}
node[sloped,above,blue,rotate=180]{label} (A) ;
\draw[color=red] (O)  to node[sloped,above]{label}(B) ;
%\draw[color=red] (B)  to node[sloped,above]{label}(O) ;
\end{tikzpicture}
\end{document}


In this example, I always thought that if I reverse the nodes then I reverse the top and bottom but I was wrong.

A solution is to use a rotation but...it's not automatic. The only idea I had, is to use the rotation after testing the angle formed by the two points and the horizontal axe.

-
The key allow upside down? –  cjorssen Jan 25 '12 at 16:11
+1 Fine ! I forgot this key :( I think it's the solution perhaps Christophe you can put your comment in an answer –  Alain Matthes Jan 25 '12 at 16:38
You can use auto=right (or left) to get consistent placement on one side of the line. This will cause issues with the placement though, since the right anchor of the node is then used. –  Roelof Spijker Jan 25 '12 at 16:39
I need to test the two propositions with concrete examples –  Alain Matthes Jan 25 '12 at 17:04

The key allow upside down might fit your needs.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \a in {0,20,...,340}{%
\draw (0,0) -- (\a:4cm)
node [pos=.75,above,sloped,allow upside down] {$\a$};}
\end{tikzpicture}
\end{document}

-