Issue 1:
Hello,

I discovered that my Seaborn-dependent package gets, as far as I can tell, eternally stuck when creating a displot histogram if using Seaborn==0.11.2 (matplotlib==3.4.2). Everything functions as intended on Seaborn v0.11.0 and 0.11.1.

While solving the issue, I narrowed the problem down to row 400 of distributions.py plot_univariate_histogram():

all_data = self.comp_data.dropna()

I was not able to view contents of self.comp_data on PyCharm's debugger, so that's the likely culprit.

Furthermore, I tested that the problem occurs with a melted & merged Data Frame that has repeated indices. Resetting of the index solves the problem and the distributions are plotted within seconds. While altering my code solved this for me, I bring this to your attention as I feel like this (at least the Python getting stuck part) is not intended.

Data and code

Note: 'Old ind' are the indices before resetting, and 'Reset ind' after reset.

Reset ind
Old ind
Channel
DistBin
Sample Group
Type
Value

0
0
DAPI10x
0
Ctrl
Area
31.2650

0
0
DAPI10x
0
Ctrl
Area
24.9275

0
0
DAPI10x
0
Ctrl
Area
81.1201

0
0
DAPI10x
0
Ctrl
Area
49.4325

0
0
DAPI10x
0
Ctrl
Area
22.3925

...
...
...
...
...
...
...

1596983
40167
DAPI10x
61
MutB
Volume
287.5537

1596984
40168
DAPI10x
61
MutB
Volume
287.5537

1596985
40169
DAPI10x
61
MutB
Volume
349.9147

1596986
40170
DAPI10x
61
MutB
Volume
453.8498

1596987
40171
DAPI10x
61
MutB
Volume
204.4056

row_order = data.loc[:, 'Type'].unique()
plot_palette = {'Ctrl': (0.39215686274509803, 0.5333333333333333, 0.9176470588235294),
'MutB': (0.9803921568627451, 0.7607843137254902, 0.0196078431372549)}

sns.displot(data=data, x='Value', hue='Sample Group', col=None, row='Type', alpha=0.4, kind='hist',
stat='probability', palette=plot_palette, kde=True, height=2.5, aspect=2.25,
row_order=row_order, discrete=False, multiple='stack',
facet_kws={'legend_out': True, 'sharex': False, 'sharey': False,
'gridspec_kws': {'top': 0.92, 'left': 0.15, 'right': 0.8, 'hspace': 0.6}}
)

Issue 2:
I am using histplot for plotting simple histogram plots for medium sized data-sizes.

I was using histplot for histogram determinations in my dataset using 0.11.1 and all worked very nicely and fast.

Then upon upgrading to 0.11.2 it suddenly never finishes and I am stuck in plotting stuff...

I have a plotting script looking like this:

plt.figure()
sns.histplot(data=df, x="AllocCores", binwidth=1, discrete=True, log_scale=(False, True))

The data-frame has 789412 entries and the span of the data df["AllocCores"].min / max is 1, 1200. So 1200 bins which I agree is very large but required in our analysis plots ;)

Using 0.11.1 I get this:

$> time python script.py
seaborn version = 0.11.1
Starting to plot...
Choosing binwidth = 120
Choosing binwidth = 1070
Choosing binwidth = 16
Choosing binwidth = 16
python script.py 40.34s user 0.83s system 155% cpu 26.479 total

note that this is plotting 16 files in less than a minute.

Using 0.11.2 I get this:

$> time python script.py
seaborn version = 0.11.2
Starting to plot...

it basically never ends... I have waited more than 10 minutes, but it isn't even done with the 1st plot.

When killing it Ctrl+^C I get this stack-trace:

File "script.py", line 96, in <module>
plot_alloccores(df)
File ".../script_lib.py", line 98, in plot_alloccores
sns.histplot(data=df, x="AllocCores", binwidth=1, discrete=True, log_scale=(False, True))
File "/opt/gnu/9.3.0/python/3.8.5/lib/python3.8/site-packages/seaborn/distributions.py", line 1462, in histplot
p.plot_univariate_histogram(
File "/opt/gnu/9.3.0/python/3.8.5/lib/python3.8/site-packages/seaborn/distributions.py", line 428, in plot_univariate_histogram
for sub_vars, sub_data in self.iter_data("hue", from_comp_data=True):
File "/opt/gnu/9.3.0/python/3.8.5/lib/python3.8/site-packages/seaborn/_core.py", line 983, in iter_data
data = self.comp_data
File "/opt/gnu/9.3.0/python/3.8.5/lib/python3.8/site-packages/seaborn/_core.py", line 1057, in comp_data
comp_col.loc[orig.index] = pd.to_numeric(axis.convert_units(orig))
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/indexing.py", line 671, in __setitem__
self._setitem_with_indexer(indexer, value)
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/indexing.py", line 1055, in _setitem_with_indexer
value = self._align_series(indexer, Series(value))
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/indexing.py", line 1173, in _align_series
ser = ser.reindex(obj.axes[0][indexer[0]], copy=True)._values
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/series.py", line 4030, in reindex
return super().reindex(index=index, **kwargs)
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/generic.py", line 4543, in reindex
return self._reindex_axes(
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/generic.py", line 4558, in _reindex_axes
new_index, indexer = ax.reindex(
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/indexes/base.py", line 3153, in reindex
indexer, missing = self.get_indexer_non_unique(target)
File "/opt/gnu/9.3.0/python/packages/3.8.5/pandas/1.0.5/lib/python3.8/site-packages/pandas-1.0.5-py3.8-linux-x86_64.egg/pandas/core/indexes/base.py", line 4486, in get_indexer_non_unique
indexer, missing = self._engine.get_indexer_non_unique(tgt_values)
File "pandas/_libs/index.pyx", line 354, in pandas._libs.index.IndexEngine.get_indexer_non_unique
File "<__array_function__ internals>", line 5, in resize
File "/opt/gnu/9.3.0/python/packages/3.8.5/numpy/1.19.1/lib/python3.8/site-packages/numpy-1.19.1-py3.8-linux-x86_64.egg/numpy/core/fromnumeric.py", line 1417, in resize
a = concatenate((a,) * n_copies)
File "<__array_function__ internals>", line 5, in concatenate
KeyboardInterrupt

I hope that this can provide enough details for finding the regression, if not and you require some kind of data-set, let me know and I'll try to cook something out. There is some sensitive data that I can't share. But I may be able to fiddle with the entries if this may aid?