2

For some reason chart size remains unchanged, although I've changed figsize parameters. Very appreciate your help :)

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
dt = pd.DataFrame({'col':[26,0,23,7,23,23,22,23,19,22,1,1,11,11,23,14,23,21,11,23,10,11,13,28,18,25,23,28,18,23,18,18,
23,18,23,24,11,28,23,23,23,23,19,23,23,23,23,22,14]})


plt.figure(figsize=(15,6))
sns.displot(dt['col'], kde=True)
plt.show() 

This is a result I get

Sergey Kuper
  • 85
  • 1
  • 6

2 Answers2

3

Try rewriting the code in this way:

g=sns.displot(dt['col'], kde=True)
g.fig.set_size_inches(15,6)

You can go through this for further information

Mohammad Atif
  • 216
  • 1
  • 4
1

Try using the height parameter (in inches) and aspect (as the ratio of widht/height)

you want a figure with an aspect ratio of 2.67

ar = width / height 
ar = 16/6 
ar = 2.67

Try this line instead:

g=sns.displot(dt['col'], kde=True,height=6,aspect=2.67)
DiegoRC
  • 13
  • 3