小编Nic*_*ini的帖子

无法解压不可迭代的 AxesSubplot 对象 - Matplotlib

我正在 python 中创建一个函数,它允许我创建两个并行图,并且它们共享两个轴:

\n
def PlotManager(data1,data2,fig):\n    f, (ax1, ax2) = fig.subplots(2, 1, sharey=True,sharex=True)\n\n    #Plot1 sopra\n    x_axis = data1.index\n    #Plot and shade the area between the upperband and the lower band grey\n    ax1.fill_between(x_axis,data1[\'Upper\'],data1[\'Lower\'], color = \'grey\', alpha= 0.5)\n    #Plot the closing price and the moving average\n    ax1.plot(x_axis,data1[\'Close\'],color = \'gold\',lw = 3,label = \'Close Price\', alpha= 0.5)\n    ax1.plot(x_axis,data1[\'SMA\'],color = \'blue\',lw = 3,label = \'Simple Moving Average\', alpha= 0.5)\n    ax1.scatter(x_axis,data1[\'Buy\'],color="green", lw=3,label="Buy",marker = "^", alpha=1)\n    ax1.scatter(x_axis,data1[\'Sell\'],color="red", lw=3,label="Sell",marker = "v", alpha = 1)\n    #Set the …
Run Code Online (Sandbox Code Playgroud)

python matplotlib iterable-unpacking

4
推荐指数
1
解决办法
4万
查看次数

标签 统计

iterable-unpacking ×1

matplotlib ×1

python ×1