0

I have probably tried all the solutions presented here, but none works.

How to increase the size of a scatter plot using Seaborn? And why does it have to be so complicated

plt.figure(figsize=(10, 8)) 
scatter_preco_area = sns.relplot(data = apartamentos,
                                 x = "Area", y = "Preco").set(title = "Relação entre área e preço")

Returns this (ignoring the figsize):

enter image description here

And this one:

scatter_preco_area = sns.relplot(data = apartamentos,
                                 x = "Area", y = "Preco").set(rc={'figure.figsize':(11.7,8.27)})

Returns the error:

AttributeError: 'AxesSubplot' object has no property 'rc'
unstuck
  • 563
  • 2
  • 12
  • 29

1 Answers1

1

height and aspect arguments could be used to change plot size. This code may works:

sns.relplot(data = apartamentos, x = "Area", y = "Preco",
            height = 8, aspect = 1.25)
eyShin
  • 86
  • 3
  • it works! And after dozens of failed attempts the chart finally has the size I want!!! I have no idea why nothing else worked, but who cares??? Thank YOU!!! – unstuck Jul 22 '21 at 09:20