matplotlib get all axes that a given figure contains to apply some settings

后端 未结 1 1597
不思量自难忘°
不思量自难忘° 2021-02-19 22:11

I\'m writing a function that modifies the axes size and position on a figure, but when comes twin axes it makes a problem:

import matplotlib.pyplot as plt

def f         


        
1条回答
  •  攒了一身酷
    2021-02-19 22:23

    I think you can use fig.get_axes().

    For example, to modify the title of the first sub-plot, you can do:

    plt.gcf().get_axes()[0].set_title("example plot")
    

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