Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

turn off axis border for polar matplotlib plot

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
like image 551
aestrivex Avatar asked Apr 03 '14 19:04

aestrivex


People also ask

How do you remove an AXE?

Click anywhere in the chart for which you want to display or hide axes. This displays the Chart Tools, adding the Design, Layout, and Format tabs. On the Layout tab, in the Axes group, click Axes. Click the type of axis that you want to display or hide, and then click the options that you want.

What are Axis spines?

Some useful methods and tricks in matplotlib and seaborn From Unsplash. Axis spines are the lines confining the plot area. Depending on the situation, we may want to remove some (or all) of them, change their color, make them less visible, regulate their width/style, or change their position.


1 Answers

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

eewh, all the anatomy terms.

like image 85
CT Zhu Avatar answered Sep 20 '22 11:09

CT Zhu