Skip to content

[Bug]: KeyError: 'PolyCollection:kwdoc' during pyplot import #28531

Closed
@GrigoriiTarasov

Description

@GrigoriiTarasov

Bug summary

import matplotlib.pyplot as plt
ValueError                                Traceback (most recent call last)
File ~/mambaforge/envs/boosting_mle/lib/python3.11/site-packages/matplotlib/_docstring.py:57, in _ArtistKwdocLoader.__missing__(self, key)

File ~/mambaforge/envs/boosting_mle/lib/python3.11/site-packages/matplotlib/_docstring.py:60, in _ArtistKwdocLoader.__missing__(self, key)
     57     cls, = [cls for cls in _api.recursive_subclasses(Artist)
     58             if cls.__name__ == name]
     59 except ValueError as e:
---> 60     raise KeyError(key) from e
     61 return self.setdefault(key, kwdoc(cls))

KeyError: 'PolyCollection:kwdoc'

Code for reproduction

conda list | grep matplot
matplotlib                3.8.4           py311h06a4308_0  
matplotlib-base           3.8.4           py311ha02d727_0  
matplotlib-inline         0.1.7              pyhd8ed1ab_0 
import matplotlib.pyplot as plt

and

import matplotlib

backend_name = 'agg' 
matplotlib.use(backend_name)
print(matplotlib.get_backend())

import matplotlib.pyplot as plt


### Actual outcome

plt not imported

### Expected outcome

`import matplotlib.pyplot as plt `
works

### Additional information

_No response_

### Operating system

Ubuntu

### Matplotlib Version

3.8.4

### Matplotlib Backend

agg, module://matplotlib_inline.backend_inline

### Python version

3.11

### Jupyter version

4.0.11 

### Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions