2

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?
  • Can you please expand your code snippet to a minimal working example (MWE)? It should start with \documentclass and end with \end{document}. – Matthew Leingang May 16 '13 at 13:07
  • \documentclass[8pt]{beamer} \usepackage{beamerthemesplit} \usepackage{graphics} \usepackage{ngerman} \usepackage[latin1]{inputenc} \usepackage{graphicx} \usefonttheme{serif} \usepackage{tikz} \usepackage{pgfkeys} \usepackage{sansmath} \usepackage{pgfplots} \pgfplotsset{compat = newest} \usepackage{siunitx} \usepgfplotslibrary{units} \usetikzlibrary{pgfplots.polar} \usepgfplotslibrary{polar} – Christoph May 16 '13 at 13:16
  • \begin{document} \begin{frame} \begin{figure} \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{figure} \end{frame} \end{document} – Christoph May 16 '13 at 13:16
  • Thanks, but instead of making it a comment, just edit your question. Have a look at the about page and our welcome page for new users. – Matthew Leingang May 16 '13 at 13:21
1

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.

  • Hey Matthew, thank you for your fast help. It looks good but the x and y label don't look very nice now... – Christoph May 16 '13 at 13:34
  • Label placement is very customizable. Take a look at Section 4.14 of the pgfplots manual. – Matthew Leingang May 16 '13 at 16:14
  • For the label placement you can also see tex.stackexchange.com/a/116856/17151. – bersanri Jun 7 '13 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.