擅长:python、mysql、java
<p>最好的做法是将seaborn样式和上下文参数组合到一个字典中,然后将其传递给<code>plt.rc_context</code>函数:</p>
<pre><code>import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
x = np.random.normal(size=100)
with plt.rc_context(dict(sns.axes_style("whitegrid"),
**sns.plotting_context("notebook", font_scale=1.5))):
sns.kdeplot(x, shade=True)
</code></pre>