Skip to content

sns plot to pickle -> itertools deprecation warning for python 3.14 #3835

Open
@ChrisOKay

Description

@ChrisOKay

For some of my apps, I cache figures in as files via pickle. This works both for "pure matplotlib" as well as seaborn figures.

As of late, I am seeing an itertools depcreciation warning when storing sns plots this way:

import pickle
import seaborn as sns

tips = sns.load_dataset("tips")
ax = sns.boxplot(x="day", y="total_bill", data=tips)

pickle.dump(ax.get_figure(), open("temp.pkl", "wb"))

DeprecationWarning: Pickle, copy, and deepcopy support will be removed from itertools in Python 3.14.

This warning does not occur when storing pure matplotlib plots. My guess is that this storing technique will fail for sns plots with python >= 3.14. Is there a way to avoid this?

Versions:
sns: 0.13.2
plt: 3.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions