Skip to content

BUG:FutureWarning for palette parameter without hue in faceted distributions #61276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
lavaeagle2 opened this issue Apr 12, 2025 · 1 comment
Open
3 tasks done
Labels
Bug Closing Candidate May be closeable, needs more eyeballs Visualization plotting

Comments

@lavaeagle2
Copy link

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import seaborn as sns
import matplotlib.pyplot as plt

# Sample data
tips = sns.load_dataset("tips")

# Faceted distribution plot
sns.displot(data=tips, x="total_bill", palette="viridis")
plt.show()

Issue Description

When using faceted distributions with Seaborn and passing the palette parameter without assigning hue, a FutureWarning is raised. The warning suggests assigning hue and setting legend=False to avoid deprecation in future versions (v0.14.0). This behavior needs clarification or adjustment in Pandas' integration with Seaborn plotting functions.
observed behavior:
FutureWarning: Passing palette without assigning hue is deprecated and will be removed in v0.14.0. Assign the y variable to hue and set legend=False for the same effect.

Expected Behavior

The warning should either be suppressed or handled gracefully within Pandas' plotting functions when interfacing with Seaborn.

Installed Versions

/usr/local/lib/python3.11/dist-packages/_distutils_hack/init.py:31: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
warnings.warn(

INSTALLED VERSIONS

commit : d9cdd2e
python : 3.11.12.final.0
python-bits : 64
OS : Linux
OS-release : 6.1.85+
Version : #1 SMP PREEMPT_DYNAMIC Thu Jun 27 21:05:47 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 2.2.2
numpy : 2.0.2
pytz : 2025.2
dateutil : 2.8.2
setuptools : 75.2.0
pip : 24.1.2
Cython : 3.0.12
pytest : 8.3.5
hypothesis : None
sphinx : 8.2.3
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.3.1
html5lib : 1.1
pymysql : None
psycopg2 : 2.9.10
jinja2 : 3.1.6
IPython : 7.34.0
pandas_datareader : 0.10.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.3
bottleneck : 1.4.2
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.3.2
gcsfs : 2025.3.2
matplotlib : 3.10.0
numba : 0.60.0
numexpr : 2.10.2
odfpy : None
openpyxl : 3.1.5
pandas_gbq : 0.28.0
pyarrow : 18.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : 2.0.40
tables : 3.10.2
tabulate : 0.9.0
xarray : 2025.1.2
xlrd : 2.0.1
zstandard : 0.23.0
tzdata : 2025.2
qtpy : None
pyqt5 : None

Image

@lavaeagle2 lavaeagle2 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 12, 2025
@rhshadrach
Copy link
Member

This behavior needs clarification or adjustment in Pandas' integration with Seaborn plotting functions.

Can you clarify why you think this is a pandas issue?

The warning should either be suppressed or handled gracefully within Pandas' plotting functions when interfacing with Seaborn.

As far as I can tell there is no point in the callstack where seaborn is passing over control to pandas, so this is not technically possible.

I think you need to raise an issue with Seaborn, although I don't understand why you think the current warning is not appropriate.

@rhshadrach rhshadrach added Visualization plotting Closing Candidate May be closeable, needs more eyeballs and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Closing Candidate May be closeable, needs more eyeballs Visualization plotting
Projects
None yet
Development

No branches or pull requests

2 participants