[Tex/LaTex] Polar plot: label and legend rotation

pgfplotstikz-pgf

I am using the polar library with pgfplots to plot a graph like this:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
   \pgfplotsset{compat = newest}
   \usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}[scale=0.65]
\begin{polaraxis}
\addplot coordinates {(0,1) (45,1)};
\addplot coordinates {(180,0.5) (172,1) (160,1)};
\legend{test}
\end{polaraxis}
\end{tikzpicture}
\end{document}

I have 2 questions:

  1. Is it possible that the 0 degree 'label' begins in the north and not in the east?
  2. How can I rotate the legend?

Best Answer

The rotate=90 key seems to work.

\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}[scale=0.65]
\begin{polaraxis}[rotate=90]
\addplot coordinates {(0,1) (45,1)};
\addplot coordinates {(180,0.5) (172,1) (160,1)};
\legend{test}
\end{polaraxis}
\end{tikzpicture}
\end{document}

sample code output

For rotation of the legend: Christian (the package author/maintainer) wrote on gmane.comp.tex.pgfplots a while back:

the legend is typeset as pgf matrix for which the pgf manual says

Rotations and scaling have no effect on a matrix as a whole (however, you can still transform the contents of the cells normally). Before the matrix is typeset, the rotational and scaling part of the transformation matrix is reset."

It seems the rotation of the matrix is not possible.

The post is old but the pgf manual still has this passage (Section 17.2 of the v2.10 manual). So it's probably still not possible.