 # controlling padding between axis and ticklabels in polar plots

Hello,

I have a question concerning the label positions of x- or y-ticks. My
problem is that I want to make a polar plot with ticklabels. To
generate such a plot you can use the following simple example script.

# #################################################
import numpy as np
import matplotlib.pyplot as plt

r = np.linspace(0, 10, 100)
t = np.linspace(0, 4*np.pi, 100)

fig = plt.figure(1)
fig.clf()
ax.plot(t, r, lw=2)

plt.draw()
plt.show()
# ##################################################

When generating a polarplot with this script one realizes that the
r-ticklabels (y-ticklabels) end up on the gridlines. This looks looks
kind of ugly especially for the last ticklabel ("10") which breaks the
solid line at the outer plot boundary. So I would like to move the
ticklabels a little bit to the right.

My question is: Is there a simple trick to change the default
ticklabelpad between the axis and the ticklabels or do I have to do
this manually by changing the position of every single ticklabel?

With kind regards,

Daniel

There seems no obvious way to change the padding.
You may use *set_rgrids* method which takes rpad parameter but you
need to specify the tick locations also.

Here is a simple function taken from set_rgrids method, that only

angle = ax._r_label1_position.to_values()
rmax = ax.get_rmax()

Regards,

-JJ

···

On Tue, Apr 13, 2010 at 12:08 PM, Daniel Platz <mail.to.daniel.platz@...982...> wrote:

Hello,

I have a question concerning the label positions of x- or y-ticks. My
problem is that I want to make a polar plot with ticklabels. To
generate such a plot you can use the following simple example script.

# #################################################
import numpy as np
import matplotlib.pyplot as plt

r = np.linspace(0, 10, 100)
t = np.linspace(0, 4*np.pi, 100)

fig = plt.figure(1)
fig.clf()
ax.plot(t, r, lw=2)

plt.draw()
plt.show()
# ##################################################

When generating a polarplot with this script one realizes that the
r-ticklabels (y-ticklabels) end up on the gridlines. This looks looks
kind of ugly especially for the last ticklabel ("10") which breaks the
solid line at the outer plot boundary. So I would like to move the
ticklabels a little bit to the right.

My question is: Is there a simple trick to change the default
ticklabelpad between the axis and the ticklabels or do I have to do
this manually by changing the position of every single ticklabel?

With kind regards,

Daniel

------------------------------------------------------------------------------