Turn off axis border for polar matplotlib plot

Question:

I have a polar axes in matplotlib that has text which extends outside of the range of the axes. I would like to remove the border for the axis — or set it to the color of the background so that the text is more legible. How can I do this?

Simply increasing the size of the axes is not an acceptable solution (because the figure is embeddable in a GUI and it becomes too small if this is done). Changing the color of the background to be black so that the border is not visible is also not an acceptable solution.

enter image description here

A considerable amount of code that does various parts of plotting things is omitted, but here is the generation of the figure and axes itself:

import pylab as pl
fig = pl.figure(figsize=(5,5), facecolor='white')
axes = pl.subplot(111, polar=True, axisbg='white')

pl.xticks([])
pl.yticks([])
pl.ylim(0,10)

# ... draw lots of things
Asked By: aestrivex

||

Answers:

Just add this line: axes.spines['polar'].set_visible(False) and it should go away!

eewh, all the anatomy terms.

Answered By: CT Zhu

A more general way (independent of coordinate systems) is:

axes.axis("off")
Answered By: Youjun Hu