How do I change the plot size of a regplot in Seaborn?

后端 未结 2 1651
时光取名叫无心
时光取名叫无心 2021-01-12 20:11

Something similar to the fig.set_size_inches(18.5, 10.5) of matplotlib.

2条回答
  •  萌比男神i
    2021-01-12 21:11

    Or a little bit shorter:

    import numpy as np
    import seaborn as sns
    import matplotlib.pyplot as plt
    
    # some artificial data
    data = np.random.multivariate_normal([0,0], [[1,-0.5],[-0.5,1]], size=100)
    
    # plot
    sns.set_style('ticks')
    
    g = sns.regplot(data[:,0], data[:,1])
    g.figure.set_size_inches(18.5, 10.5)
    sns.despine()
    

提交回复
热议问题