I'm using sublime text 2 with skim, on Mac OSX 10.8.3.

I'm plotting microphone pick up patterns as follows:

    \begin{tikzpicture} % p56
    \begin{polaraxis} [ytick=\empty,legend entries={Omnidirectional,Figure-8,,Subcardioid,Cardioid,Supercardioid,,,,Hypercardioid,,,,},legend cell align=left,legend style={at={(1.7,0.5)},anchor=east}]
    \addplot[style=thick,domain=0:360, samples=100]{1};
        %Figure 8 (Bidirectional)
    \addplot[style=thick,color=blue,domain=0:180, samples=100]{cos(x)};
    \addplot[style=thick,color=blue,domain=180:360, samples=100]{-cos(x)};
    \addplot[style=thick,color=green,domain=0:360, samples=100]{0.7 + 0.3*cos(x)};
    \addplot[style=thick,color=brown,domain=0:360, samples=100]{0.5 + 0.5*cos(x)};
    \addplot[style=thick,color=red,domain=0:126, samples=100]{0.37 + 0.63*cos(x)};
    \addplot[style=thick,color=red,domain=126:234, samples=100]{-0.37 - 0.63*cos(x)};
    \addplot[style=thick,color=red,domain=234:360, samples=100]{0.37 + 0.63*cos(x)};
    \addplot[style=thick,color=violet, domain=0:110, samples=100]{0.25 + 0.75*cos(x)};
    \addplot[style=thick,color=violet,domain=110:250, samples=100]{-0.25 - 0.75*cos(x)};
    \addplot[style=thick,color=violet,domain=250:360, samples=100]{0.25 + 0.75*cos(x)};

This creates the correct polar plots, but the angles are without the degree symbol.

How can I add the degree symbol and also how can I remove the black radial line running from the centre horizontally to the right?

  • Welcome to TeX.SX. You might have a look to our start page: it will help you to familiarize with the site. – Claudio Fiandrino May 28 '13 at 10:17
  • 1
    You should improve your example. Probably it's not needed to have so many \addplot commands. Additionaly, this is not a fully working minimal working example, so you probably should use the class article and load the minimum amount of packages to get your code compilable. – Patrick Häcker May 28 '13 at 10:37

For printing the degree symbol in the tick labels, you can set xticklabel=$\pgfmathprintnumber{\tick}^\circ$ (\pgfmathprintnumber makes sure that the numbers are rounded nicely, \tick contains the label value, and \circ is the symbol).

The horizontal black line is the y axis, which you can hide using the key hide y axis.

Bonus hints: Instead of using empty legend entries, you can add forget plot to the helper plots. That way they won't get a legend entry. In your case, you don't even need the helper plots: You can let all plots run from 0 to 360 degrees, and use abs(<expr>) instead of just <expr> to get the same results.

For line plots, you don't need to say color=red, you can just say red.

Options that are common to all plots can be set using every axis plot/.style={thick, samples=100, domain=0:360}, which helps keep the code leaner and more maintainable.



 \begin{tikzpicture} % p56
    \begin{polaraxis} [
            hide y axis,
            legend entries={
            legend cell align=left,
            legend style={
            every axis plot/.style={
        %Figure 8 (Bidirectional)
    \addplot[green]{0.7 + 0.3*cos(x)};
    \addplot[brown]{0.5 + 0.5*cos(x)};
    \addplot[red]{abs(0.37 + 0.63*cos(x))};
    \addplot[violet]{abs(0.25 + 0.75*cos(x))};
  • This response has a small typo; the text says "yticklabel" but the example has the correct "xticklabel" for the angular axis. I lack the points to make such a "trivial" edit. – Liam Dec 3 '13 at 20:56
  • @Liam: You're absolutely right, thanks Liam! – Jake Dec 3 '13 at 20:59

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.