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

Stroked path width#17198

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
brunobeltran wants to merge2 commits intomatplotlib:main
base:main
Choose a base branch
Loading
frombrunobeltran:stroked_path_width
Draft
Show file tree
Hide file tree
Changes fromall 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
10 changes: 10 additions & 0 deletionsdoc/users/next_whats_new/2020-06-17-path-extents.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
New function to get Path's *stroked* Bbox
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A Path is typically drawn by stroking it (with some ``markeredgewidth``), an
operation which changes its bounding box in a nontrivial way, depending on the
Path's joinstyle, capstyle, miterlimit, and shape.

`~.path.Path.get_stroked_extents` was added to allow computation of the final
bounding box in pixel/points coordinates of the line, after it has been drawn
(and accounting for the joinstyle, capstyle, and miterlimit).
14 changes: 14 additions & 0 deletionslib/matplotlib/bezier.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -235,6 +235,20 @@ def degree(self):
"""Degree of the polynomial. One less the number of control points."""
return self._N - 1

@property
def tan_in(self):
if self._N < 2:
raise ValueError("Need at least two control points to get tangent "
"vector!")
return self.control_points[1] - self.control_points[0]

@property
def tan_out(self):
if self._N < 2:
raise ValueError("Need at least two control points to get tangent "
"vector!")
return self.control_points[-1] - self.control_points[-2]

@property
def polynomial_coefficients(self):
r"""
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp