[英]How do I change the background color of a matplotlib inline plot in LightTable?
How do I change the background color of the sides of a matplotlib inline plot in LightTable? 如何更改LightTable中matplotlib内联图的侧面的背景颜色? In the image below, it's a little difficult to see the axis labels.
在下图中,很难看到轴标签。 I'm fine with either a python-based solution (ie modification of the python code shown), or a LightTable-based solution (ie a change in one of the settings files, but I'm not sure which one--eg is it user.behaviors?).
我可以使用基于python的解决方案(即对所示的python代码进行修改),也可以基于LightTable的解决方案(即对其中一个设置文件进行更改),但我不确定哪一个(例如它是user.behaviors吗?)。
If you create a figure first, you can set the background colour using patch.set_facecolor
: 如果首先创建图形,则可以使用
patch.set_facecolor
设置背景色:
fig=plt.figure()
fig.patch.set_facecolor('white')
Not sure if that works in LightTable (never used it before), but that does work in an ipython session so hopefully its portable to LightTable 不确定在LightTable中是否可以使用(以前从未使用过),但是在ipython会话中确实可以使用,因此希望它可移植到LightTable中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.