0

I am trying to enlarge the x-axis labels (that is 'onshore', 'offshore', and 'solar'), along with rotating them. But whenever I increase the size, the column sizes of my cat subplots decrease and compress the image. Is there a way to increase the font size of axis labels without decreasing/compressing the subplots in the seaborn catplot?

Here is my code:

#plt.subplots(figsize=(28,12))
sns.set_theme(style = "whitegrid", font_scale= 1.9)
ax = sns.catplot(x="generator", y="ELCC", hue="Nameplate Capacity",
            col="Scenario", aspect=.7,
            kind="box",palette = 'RdYlBu', data=final_df)
plt.legend(bbox_to_anchor = (1, 1))
ax.set_xticklabels(rotation = 30)
ax.set_xlabels('Generator Type', fontsize=20) # not set_label
ax.set_ylabels('ELCC', fontsize= 20)
ax.fig.set_size_inches(45,22)
plt.show()

My plot so far:

pandi20
  • 11
  • 1
  • 5
  • `sns.set_theme(style = "whitegrid", font_scale= 1.9)`What happens if I don't need this line? Why isn't font resize enabled? – r-beginners Jul 20 '21 at 04:01
  • This line is needed to scale up the subplot font size, for example, the text above plot and also 'solar', 'onshore, 'offshore' – pandi20 Jul 20 '21 at 17:23

1 Answers1

0

For those facing the same issue - I found a fix, play around with the 'height' and 'aspect' parameters of the catplot in Seaborn. The width of each facet or each subplot is equal to height*aspect. This stackoverflow post was helpful.

pandi20
  • 11
  • 1
  • 5