Delete a subplot

前端 未结 2 1309
你的背包
你的背包 2020-12-13 06:04

I\'m trying to figure out a way of deleting (dynamically) subplots in matplotlib. I see they have a remove method, but I get the error

NotImplem         


        
相关标签:
2条回答
  • 2020-12-13 06:35
    ax.set_visible(False)
    

    will suffice in most cases.

    0 讨论(0)
  • 2020-12-13 06:38

    Wow, ok well I feel really stupid :P

    from matplotlib import pyplot as plt
    fig, axs = plt.subplots(1,3)
    axs[0].plot([1,2],[3,4])
    axs[2].plot([0,1],[2,3])
    fig.delaxes(axs[1])
    plt.draw()
    

    In case anyone else needs it.

    0 讨论(0)
提交回复
热议问题