0

I'm plotting facet grid so that my x-axis ticks are dates (dd-mm-yy) and it doesn't look so good. Is there a way to change the size of the grid (like figsize)?

g = sns.FacetGrid(c53_grid, col='question',col_wrap = 4, 
margin_titles=True)
g = g.map(plt.plot, "submitted_at", "int_value_0")
g = g.map(plot_mean, 'int_value_0', ls=":", c=".5")
g.set_titles("{col_name}")
g.set_xticklabels(rotation = 45)
Neta Geva
  • 21
  • 1
  • 5

1 Answers1

5

You can set the height parameter (value in inches) and the aspect parameter (height*aspect=width).

In your case:

g = sns.FacetGrid(c53_grid, col='question',col_wrap = 4, 
margin_titles=True, height=3, aspect= 1,33) #4/3 ratio
g = g.map(plt.plot, "submitted_at", "int_value_0")
g = g.map(plot_mean, 'int_value_0', ls=":", c=".5")
g.set_titles("{col_name}")
g.set_xticklabels(rotation = 45)

I suggest you to have a look at the documentation

CAPSLOCK
  • 6,243
  • 3
  • 33
  • 56
  • 1
    Thank you so much! I was trying to change figure size in jupyter notebook. plt.figure(figsize=... didn't do it, also plt.RCparams didn't work. But this did xD – TheRibosome May 02 '22 at 12:27