proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.12k stars 102 forks source link

MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "facecolor" which is no longer supported as of 3.3 and will become an error two minor releases later #456

Open yykphy opened 6 months ago

yykphy commented 6 months ago

Description

A deprecation warning with savefig() has been displayed for a long time and has not been solved.

/Users/yk/anaconda3/lib/python3.11/site-packages/proplot/figure.py:469: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "facecolor" which is no longer supported as of 3.3 and will become an error two minor releases later return func(self, *args, **kwargs)

Steps to reproduce

import proplot as pplt
import numpy as np

x = np.linspace(0, 10, 100) 
y = np.sin(x)

fig, ax = pplt.subplots()
ax.plot(x,y)
ax.format(xlabel='x axis', ylabel='y axis')
fig.savefig('test.pdf')

Expected behavior: No warning

Actual behavior:

/Users/yk/anaconda3/lib/python3.11/site-packages/proplot/figure.py:469: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "facecolor" which is no longer supported as of 3.3 and will become an error two minor releases later return func(self, *args, kwargs) /Users/yk/anaconda3/lib/python3.11/site-packages/proplot/figure.py:469: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "edgecolor" which is no longer supported as of 3.3 and will become an error two minor releases later return func(self, *args, *kwargs) /Users/yk/anaconda3/lib/python3.11/site-packages/proplot/figure.py:469: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "orientation" which is no longer supported as of 3.3 and will become an error two minor releases later return func(self, args, kwargs)

Proplot version

matplotlib: 3.4.3 proplot: 0.9.7 python: 3.11 Computer: macbook pro, m2pro

cvanelteren commented 3 months ago

Fixed with https://github.com/proplot-dev/proplot/pull/459#issuecomment-2291293343