使用matplotlib更改背景*无需*框架 [英] change background *without* a frame with matplotlib

查看:41
本文介绍了使用matplotlib更改背景*无需*框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出此代码,

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.

我不想使用框架.

推荐答案

调用figure()时需要为facecolor参数指定一个参数:

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)

这篇关于使用matplotlib更改背景*无需*框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆