Show tick labels when sharing an axis in matplotlib

后端 未结 3 1756
醉话见心
醉话见心 2020-12-05 10:50

I\'m running the following function:

def plot_variance_analysis(indices, stat_frames, legend_labels, shape):
    x = np.linspace(1, 5, 500)
    fig, axes = p         


        
3条回答
  •  不思量自难忘°
    2020-12-05 11:35

    You can find extra information about labels of matplotlib here: https://matplotlib.org/3.1.3/api/_as_gen/matplotlib.axes.Axes.tick_params.html

    In my case, I need to turn on all the x and y labels and this solution works:

    for ax in axes.flatten():
        ax.xaxis.set_tick_params(labelbottom=True)
        ax.yaxis.set_tick_params(labelleft=True)
    

提交回复
热议问题