Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change background *without* a frame with matplotlib

Given this code,

from pylab import *
ion()
axes(frameon = 0, aspect = 1, polar = 1)
grid (True)

I get the window, containing the axes, where I can plot what I need.

I want to change the background of this window from the standard gray to another color.

I do not want to use a frame.

like image 481
alinsoar Avatar asked Feb 16 '23 08:02

alinsoar


1 Answers

You need to specify an argument to the facecolor parameter when calling figure():

from pylab import *
ion()
figure(facecolor='white') # Or any other color
axes(frameon = 0, aspect = 1, polar = 1)
grid(True)

enter image description here

like image 180
sodd Avatar answered Feb 24 '23 09:02

sodd