相关疑难解决方法(0)

matplotlib:不同尺度的叠加图?

到目前为止,我有以下代码:

colors = ('k','r','b')
ax = []
for i in range(3):
    ax.append(plt.axes())
    plt.plot(datamatrix[:,0],datamatrix[:,i],colors[i]+'o')
    ax[i].set(autoscale_on=True)
Run Code Online (Sandbox Code Playgroud)

通过autoscale_on=True每个轴的选项,我认为每个绘图应该有自己的y轴限制,但看起来它们都共享相同的值(即使它们共享不同的轴).如何将它们设置为缩放以显示每个的范围datamatrix[:,i](只是显式调用.set_ylim()?)而且,如何为datamatrix[:,2]上面可能需要的第三个变量()创建偏移y轴?谢谢大家.

python matplotlib

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

标签 统计

matplotlib ×1

python ×1