簡體   English   中英

如何更改 seaborn 散點圖的繪圖大小?

[英]How do I change the plot size for a seaborn scatter plot?

我可能已經嘗試了此處介紹的所有解決方案,但都沒有奏效。

如何使用 Seaborn 增加散點圖的大小? 為什么要這么復雜

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")

返回這個(忽略 figsize):

在此處輸入圖片說明

還有這個:

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

返回錯誤:

AttributeError: 'AxesSubplot' object has no property 'rc'

heightaspect參數可用於更改繪圖大小。 此代碼可能有效:

sns.relplot(data = apartamentos, x = "Area", y = "Preco",
            height = 8, aspect = 1.25)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM