Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecate axis_artist.BezierPath. #14786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/api/next_api_changes/2019-07-15-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API changes and deprecations
````````````````````````````

``axisartist.axis_artist.BezierPath`` is deprecated (use `.patches.PathPatch`
to draw arbitrary Paths).

``AxisArtist.line`` is now a `.patches.PathPatch` instance instead of a
``BezierPath`` instance.
3 changes: 3 additions & 0 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ def __init__(self, path, **kwargs):
def get_path(self):
return self._path

def set_path(self, path):
self._path = path


class Polygon(Patch):
"""
Expand Down
7 changes: 6 additions & 1 deletion lib/mpl_toolkits/axisartist/axis_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@
from matplotlib.artist import Artist
from matplotlib.collections import LineCollection
from matplotlib.lines import Line2D
from matplotlib.patches import PathPatch
from matplotlib.path import Path
from matplotlib.transforms import (
Affine2D, Bbox, IdentityTransform, ScaledTranslation, TransformedPath)

from .axisline_style import AxislineStyle


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

def __init__(self, path, *args, **kwargs):
Expand Down Expand Up @@ -926,10 +928,13 @@ def _init_line(self):

axisline_style = self.get_axisline_style()
if axisline_style is None:
self.line = BezierPath(
self.line = PathPatch(
self._axis_artist_helper.get_line(self.axes),
color=rcParams['axes.edgecolor'],
fill=False,
linewidth=rcParams['axes.linewidth'],
capstyle=rcParams['lines.solid_capstyle'],
joinstyle=rcParams['lines.solid_joinstyle'],
transform=tran)
else:
self.line = axisline_style(self, transform=tran)
Expand Down