Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug summary
The problem is that deepcopy of TextPath calls deepcopy of Path. In turn Path utilizes super().init for creating a new
instance. However, Path.init and TextPath.init are completely different.
Code for reproduction
frommatplotlib.textpathimportTextPathTextPath((0,0),".").deepcopy()
Actual outcome
AttributeErrorTraceback (mostrecentcalllast)c:\figures.pyin<module>---->1TextPath((0,0),".").deepcopy()~\.site-packages\matplotlib\path.pyin__deepcopy__(self,memo)284returnself.__class__(285self.vertices.copy(),codes,-->286_interpolation_steps=self._interpolation_steps)287288deepcopy=__deepcopy__~\.site-packages\matplotlib\textpath.pyin__init__(self,xy,s,size,prop,_interpolation_steps,usetex)394395self._cached_vertices=None-->396s,ismath=Text(usetex=usetex)._preprocess_math(s)397self._vertices,self._codes=text_to_path.get_text_path(398prop,s,ismath=ismath)~\.site-packages\matplotlib\text.pyin_preprocess_math(self,s)1186returns,True1187else:->1188returns.replace(r"\$","$"),False11891190defset_fontproperties(self,fp):AttributeError:'list'objecthasnoattribute'replace'
Expected outcome
A new instance of TextPath.
Operating system
Windows 10
Matplotlib Version
3.3.4
Matplotlib Backend
module://ipykernel.pylab.backend_inline
Python version
Python 3.6.6
Jupyter version
No response
Other libraries
No response
Installation
pip
Conda channel
No response
Metadata
Metadata
Assignees
Labels
No labels