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

Commite92da6b

Browse files
committed
backport bezier import fix without API change
1 parentbcc2852 commite92da6b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

‎doc/api/next_api_changes/removals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Classes, methods and attributes
103103

104104
- ``image.BboxImage.interp_at_native`` property (no replacement)
105105
- ``lines.Line2D.verticalOffset`` property (no replacement)
106-
- ``bezier.find_r_to_boundary_of_closedpath()`` (norelacement)
106+
- ``bezier.find_r_to_boundary_of_closedpath()`` (noreplacement)
107107

108108
- ``quiver.Quiver.color()`` (use ``Quiver.get_facecolor()`` instead)
109109
- ``quiver.Quiver.keyvec`` property (no replacement)

‎lib/matplotlib/bezier.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
importnumpyasnp
88

99
importmatplotlib.cbookascbook
10-
frommatplotlib.pathimportPath
1110

1211

1312
classNonIntersectingPathException(ValueError):
1413
pass
1514

15+
1616
# some functions
1717

1818

@@ -230,6 +230,7 @@ def split_path_inout(path, inside, tolerance=0.01, reorder_inout=False):
230230
Divide a path into two segments at the point where ``inside(x, y)`` becomes
231231
False.
232232
"""
233+
from .pathimportPath
233234
path_iter=path.iter_segments()
234235

235236
ctl_points,command=next(path_iter)
@@ -486,6 +487,7 @@ def make_path_regular(p):
486487
with ``codes`` set to (MOVETO, LINETO, LINETO, ..., LINETO); otherwise
487488
return *p* itself.
488489
"""
490+
from .pathimportPath
489491
c=p.codes
490492
ifcisNone:
491493
c=np.full(len(p.vertices),Path.LINETO,dtype=Path.code_type)
@@ -498,6 +500,5 @@ def make_path_regular(p):
498500
@cbook.deprecated("3.3",alternative="Path.make_compound_path()")
499501
defconcatenate_paths(paths):
500502
"""Concatenate a list of paths into a single path."""
501-
vertices=np.concatenate([p.verticesforpinpaths])
502-
codes=np.concatenate([make_path_regular(p).codesforpinpaths])
503-
returnPath(vertices,codes)
503+
from .pathimportPath
504+
returnPath.make_compound_path(*paths)

‎lib/matplotlib/path.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ def unit_rectangle(cls):
647647
defunit_regular_polygon(cls,numVertices):
648648
"""
649649
Return a :class:`Path` instance for a unit regular polygon with the
650-
given *numVertices* and radius of 1.0, centered at (0, 0).
650+
given *numVertices* such that the circumscribing circle has radius 1.0,
651+
centered at (0, 0).
651652
"""
652653
ifnumVertices<=16:
653654
path=cls._unit_regular_polygons.get(numVertices)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp