【发布时间】:2020-05-16 08:24:48
【问题描述】:
我在 python 中创建饼图,由于自定义,我在函数中编写饼图。 现在,我想创建一个子图,其中每个图都是函数的输出。但是,生成的饼图有空格,我该如何去掉多余的空格? 请参考下面的代码,我错过了什么吗?
a= pd.DataFrame([1,2,3])
def test(x):
x.plot.pie(y=0);
fig= plt.figure(); # create a figure object
fig.add_subplot(1, 2, 1); # create an axes object in the figure
test(a)
fig.add_subplot(1, 2, 2) ; # create an axes object in the figure
test(a)
如何将地块置于子地块中的正确位置?
【问题讨论】:
标签: function matplotlib subplot