How to plot pcolor colorbar in a different subplot - matplotlib

前端 未结 2 1560
别跟我提以往
别跟我提以往 2021-02-08 05:32

I am trying to split my plots in different subplots.. What I want to achieve is to put a colorbar for a subplot in a different subplot. Right now I am using:

# fi         


        
2条回答
  •  一向
    一向 (楼主)
    2021-02-08 06:24

    I believe you should use ax instead of cax.

    # colorbar
    axes = plt.subplot2grid((4, 2), (0, 1), rowspan=3)
    plt.colorbar(pc, ax=axes)
    

提交回复
热议问题