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

Appearance settings

Commit 9f1c730

Browse filesBrowse files
authored
Merge pull request #14786 from anntzer/bezierpath
Deprecate axis_artist.BezierPath.
2 parents bfda3a4 + 3fa8f1e commit 9f1c730
Copy full SHA for 9f1c730

File tree

Expand file treeCollapse file tree

3 files changed

+17
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+17
-1
lines changed
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
API changes and deprecations
2+
````````````````````````````
3+
4+
``axisartist.axis_artist.BezierPath`` is deprecated (use `.patches.PathPatch`
5+
to draw arbitrary Paths).
6+
7+
``AxisArtist.line`` is now a `.patches.PathPatch` instance instead of a
8+
``BezierPath`` instance.

‎lib/matplotlib/patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/patches.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,9 @@ def __init__(self, path, **kwargs):
941941
def get_path(self):
942942
return self._path
943943

944+
def set_path(self, path):
945+
self._path = path
946+
944947

945948
class Polygon(Patch):
946949
"""

‎lib/mpl_toolkits/axisartist/axis_artist.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axisartist/axis_artist.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,15 @@
9696
from matplotlib.artist import Artist
9797
from matplotlib.collections import LineCollection
9898
from matplotlib.lines import Line2D
99+
from matplotlib.patches import PathPatch
99100
from matplotlib.path import Path
100101
from matplotlib.transforms import (
101102
Affine2D, Bbox, IdentityTransform, ScaledTranslation, TransformedPath)
102103

103104
from .axisline_style import AxislineStyle
104105

105106

107+
@cbook.deprecated("3.2", alternative="matplotlib.patches.PathPatch")
106108
class BezierPath(Line2D):
107109

108110
def __init__(self, path, *args, **kwargs):
@@ -908,10 +910,13 @@ def _init_line(self):
908910

909911
axisline_style = self.get_axisline_style()
910912
if axisline_style is None:
911-
self.line = BezierPath(
913+
self.line = PathPatch(
912914
self._axis_artist_helper.get_line(self.axes),
913915
color=rcParams['axes.edgecolor'],
916+
fill=False,
914917
linewidth=rcParams['axes.linewidth'],
918+
capstyle=rcParams['lines.solid_capstyle'],
919+
joinstyle=rcParams['lines.solid_joinstyle'],
915920
transform=tran)
916921
else:
917922
self.line = axisline_style(self, transform=tran)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.