<p dir="auto">I had some plotting code running on seaborn 0.10:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def plot_oos(X_hat, oos_vertices, labels, oos_labels, title):
    # Plot the in-sample latent positions
    plot = pairplot(X_hat, labels=labels, title=title)

    # generate out-of-sample dataframe
    oos_vertices = np.atleast_2d(oos_vertices)
    data = {'Type': oos_labels, 
          'Dimension 1': oos_vertices[:, 0], 
          'Dimension 2': oos_vertices[:, 1]}
    oos_df = pd.DataFrame(data=data)
    
    # update plot with out-of-sample latent positions,
    # plotting out-of-sample latent positions as stars
    plot.data = oos_df
    plot.hue_vals = oos_df[&quot;Type&quot;]
    plot.map_offdiag(plt.scatter, s=500, marker=&quot;*&quot;, edgecolor=&quot;black&quot;)"><pre class="notranslate"><code class="notranslate">def plot_oos(X_hat, oos_vertices, labels, oos_labels, title):
    # Plot the in-sample latent positions
    plot = pairplot(X_hat, labels=labels, title=title)

    # generate out-of-sample dataframe
    oos_vertices = np.atleast_2d(oos_vertices)
    data = {'Type': oos_labels, 
          'Dimension 1': oos_vertices[:, 0], 
          'Dimension 2': oos_vertices[:, 1]}
    oos_df = pd.DataFrame(data=data)
    
    # update plot with out-of-sample latent positions,
    # plotting out-of-sample latent positions as stars
    plot.data = oos_df
    plot.hue_vals = oos_df["Type"]
    plot.map_offdiag(plt.scatter, s=500, marker="*", edgecolor="black")
</code></pre></div>
<p dir="auto">Here, <code class="notranslate">pairplot</code> is a wrapper on seaborn's <code class="notranslate">pairplot</code>, which is why it has different arguments. The wrapper returns a seaborn <code class="notranslate">PairGrid</code>.</p>
<p dir="auto">The last three lines are the most important. They essentially updated the data and hue-values inside a pairplot with new data, then mapped it onto the pairplot. This function was quite useful for me -- I use variations of it all the time to add stuff to PairGrid plots.</p>
<p dir="auto">Using <code class="notranslate">seaborn 11.0</code> broke this code -- the <code class="notranslate">plot.map_offdiag</code> line no longer does anything -- and I'm trying to understand why. Is this a bug, or a feature? I see that <a href="https://seaborn.pydata.org/whatsnew.html" rel="nofollow">whatsnew</a> talks about changing delegation of <code class="notranslate">hue</code> handling, but I don't fully understand what this changes.</p>
<p dir="auto">See below for example. The top picture correctly has the added data (plotted large, with the star marker), and the bottom plot does not have the added data. Plots were generated with the same code on seaborn 0.10.0, and then 0.11.0.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12386450/99010865-b103aa80-24ff-11eb-956f-771b1765ee04.png"><img width="388" alt="Screen Shot 2020-11-12 at 6 56 16 PM" src="https://user-images.githubusercontent.com/12386450/99010865-b103aa80-24ff-11eb-956f-771b1765ee04.png" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12386450/99010919-cc6eb580-24ff-11eb-9794-bf7a763e5106.png"><img width="412" alt="Screen Shot 2020-11-12 at 6 57 31 PM" src="https://user-images.githubusercontent.com/12386450/99010919-cc6eb580-24ff-11eb-9794-bf7a763e5106.png" style="max-width: 100%;"></a></p>
<p dir="auto">Hi,</p>
<p dir="auto">I discovered that the map_* methods of PairGrid seem to be broken in version 0.11.0 for user defined functions. See reproducible example below with a corrfunc defined to plot the pearson correlation value on the lower plots. The function doesn't seem to get evaluated in version 0.11.0. When I pip install seaborn==0.10.1, I get the desired result. Plots from both cases also attached.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy import stats
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style=&quot;white&quot;)

mean = np.zeros(3)
cov = np.random.uniform(.2, .4, (3, 3))
cov += cov.T
cov[np.diag_indices(3)] = 1
data = np.random.multivariate_normal(mean, cov, 100)
df = pd.DataFrame(data, columns=[&quot;X&quot;, &quot;Y&quot;, &quot;Z&quot;])

def corrfunc(x, y,**kws):
    r, _ = stats.pearsonr(x, y)
    ax = plt.gca()
    ax.annotate(&quot;r = {:.2f}&quot;.format(r),
                xy=(.1, .9), xycoords=ax.transAxes)

g = sns.PairGrid(df, palette=[&quot;red&quot;])
g.map_upper(plt.scatter, s=10)
g.map_diag(sns.distplot, kde=False)
g.map_lower(sns.kdeplot, cmap=&quot;Blues_d&quot;)
g.map_lower(corrfunc)
plt.show()
"><pre lang="import" class="notranslate"><code class="notranslate">from scipy import stats
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")

mean = np.zeros(3)
cov = np.random.uniform(.2, .4, (3, 3))
cov += cov.T
cov[np.diag_indices(3)] = 1
data = np.random.multivariate_normal(mean, cov, 100)
df = pd.DataFrame(data, columns=["X", "Y", "Z"])

def corrfunc(x, y,**kws):
    r, _ = stats.pearsonr(x, y)
    ax = plt.gca()
    ax.annotate("r = {:.2f}".format(r),
                xy=(.1, .9), xycoords=ax.transAxes)

g = sns.PairGrid(df, palette=["red"])
g.map_upper(plt.scatter, s=10)
g.map_diag(sns.distplot, kde=False)
g.map_lower(sns.kdeplot, cmap="Blues_d")
g.map_lower(corrfunc)
plt.show()

</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3239171/94969718-380d3e00-04d1-11eb-821b-9aad80ec696e.png"><img src="https://user-images.githubusercontent.com/3239171/94969718-380d3e00-04d1-11eb-821b-9aad80ec696e.png" alt="seaborn-0-11-0" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3239171/94969722-3a6f9800-04d1-11eb-8ef1-861d9beb1f26.png"><img src="https://user-images.githubusercontent.com/3239171/94969722-3a6f9800-04d1-11eb-8ef1-861d9beb1f26.png" alt="seaborn-0-10-1" style="max-width: 100%;"></a></p>