matplotlib: adding second axes() with transparent background?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Define data x = np.linspace(0,2*np.pi,100) y = 2*np.sin(x) Plot fig = plt.figure() ax = plt.axes() fig.add_subplot(ax) ax.plot(x,y) Add second axis newax = plt.axes(axisbg='none') Gives me ValueError: Unknown element o , even though it does the same thing as what I am about to describe. I can also see that this works (no error) to do the same thing: newax = plt.axes() fig.add_subplot(newax) newax.set_axis_bgcolor('none') However, it turns the background color of the original figure "gray" (or whatever the figure background is)? I don't