Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Deepcopy of TextPath fails #20943

Closed
Milestone
@deep-jkl

Description

@deep-jkl

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp