Seaborn Catplot only changing the X and Y labels on 1 of the rows

Viewed 10146

I have created the following catplot with this code:

tkt_plot_detailed = sns.catplot(data=resolved_time_length, x='Time_to_resolve_days',y='Ticket_category',
       kind='box',row='Priority_level',height=4,aspect=3,
       orient="h",linewidth=2.5)
plt.xlabel('Days to Resolve', fontsize=15)
plt.ylabel('Ticket Category', fontsize=15)
plt.xlim(-1,30)
plt.show()

This produces this graph: enter image description here

The problem that I have is that i have changed the x and y label texts and font sizes but this changes have only taken effect on the bottom row of the graph. How can I make the changed to all the rows of my graph please?

2 Answers

Either of these two ways should work:

tkt_plot_detailed.set_xlabels('Days to Resolve', fontsize=15) # not set_label
tkt_plot_detailed.set_ylabels('Ticket Category', fontsize=15)

Or:

for ax in tkt_plot_detailed.axes.flatten():
    ax.xlabel('Days to Resolve', fontsize=15)
    ax.ylabel('Ticket Category', fontsize=15)

The accepted answers didn't work for me. But this code from the docs worked:

tkt_plot_detailed.set_axis_labels("Days to Resolve", "Ticket Category")
Related