Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MatplotlibDeprecationWarning when updating rcparams #20249

Closed
@gibbycu

Description

@gibbycu

Bug report

Bug summary
Updating RC params in code produces a deprecation warning. In order to control rcParams for an internal library I am reading in parameters and popping some that I don't want used. I am using a variation on the code below. I think I have traced it to the _validators dictionary in matplotlib.rcsetup.py

Code for reproduction
This code reproduces the error.

import matplotlib as mpl
rc = dict(mpl.rc_params())
mpl.rcParams.update(rc)

Actual outcome

C:\Users\User\miniconda3\envs\testmpl\lib\_collections_abc.py:841: MatplotlibDeprecationWarning: 
The datapath rcparam was deprecated in Matplotlib 3.2.1 and will be removed two minor releases later.
  self[key] = other[key]
C:\Users\User\miniconda3\envs\testmpl\lib\_collections_abc.py:841: MatplotlibDeprecationWarning: 
The savefig.frameon rcparam was deprecated in Matplotlib 3.1 and will be removed in 3.3.
  self[key] = other[key]
C:\Users\User\miniconda3\envs\testmpl\lib\_collections_abc.py:841: MatplotlibDeprecationWarning: 
The text.latex.unicode rcparam was deprecated in Matplotlib 3.0 and will be removed in 3.2.
  self[key] = other[key]
C:\Users\User\miniconda3\envs\testmpl\lib\_collections_abc.py:841: MatplotlibDeprecationWarning: 
The verbose.fileo rcparam was deprecated in Matplotlib 3.1 and will be removed in 3.3.
  self[key] = other[key]
C:\Users\User\miniconda3\envs\testmpl\lib\_collections_abc.py:841: MatplotlibDeprecationWarning: 
The verbose.level rcparam was deprecated in Matplotlib 3.1 and will be removed in 3.3.
  self[key] = other[key]

Expected outcome
I would expect Matplotlib to not load deprecated rcParams

Matplotlib version

  • Operating system: Windows
  • Matplotlib version: 3.4.2
  • Matplotlib backend: 'Qt5Agg'
  • Python version: 3.9.4
  • Jupyter version (if applicable):
  • Other libraries:

Setup a conda environment and just specified matplotlib from conda-forge

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions