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

Commitaf07100

Browse files
committed
Merge pull request#1964 from cimarronm/data_spine_right_top_location_fix
Fixes issue#1960. Account for right/top spine data offset on transform ...
2 parents1f07cb8 +6f45b43 commitaf07100

File tree

6 files changed

+564
-0
lines changed

6 files changed

+564
-0
lines changed

‎doc/api/api_changes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ For new features that were added to matplotlib, please see
1515
Changes in 1.3.x
1616
================
1717

18+
* Fixed a bug in setting the position for the right/top spine with data
19+
position type. Previously, it would draw the right or top spine at
20+
+1 data offset.
21+
1822
* In:class:`~matplotlib.patches.FancyArrow`, the default arrow head width,
1923
``head_width``, has been made larger to produce a visible arrow head. The new
2024
value of this kwarg is ``head_width = 20 * width``.

‎lib/matplotlib/spines.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ def _calc_offset_transform(self):
323323
self._spine_transform= ('identity',
324324
mtransforms.IdentityTransform())
325325
elifposition_type=='data':
326+
ifself.spine_typein ('right','top'):
327+
# The right and top spines have a default position of 1 in
328+
# axes coordinates. When specifying the position in data
329+
# coordinates, we need to calculate the position relative to 0.
330+
amount-=1
326331
ifself.spine_typein ('left','right'):
327332
self._spine_transform= ('data',
328333
mtransforms.Affine2D().translate(
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp