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

Commite1d2781

Browse files
committed
Use the correct aspect ratio for non-full polar Axes
No longer expand the wedge bbox to make a square, but instead export atwhatever size it has. Then also apply its aspect ratio to the Axesitself, so that the Axes' 'active' position is correct.This allows wedge-shaped PolarAxes to expand to fill their allocatedspace.
1 parent6a5fd7b commite1d2781

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

‎lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,12 +773,6 @@ def get_points(self):
773773
wedge.set_width(width)
774774
self.update_from_path(wedge.get_path(),ignore=True)
775775

776-
# Ensure equal aspect ratio.
777-
w,h=self._points[1]-self._points[0]
778-
deltah=max(w-h,0)/2
779-
deltaw=max(h-w,0)/2
780-
self._points+=np.array([[-deltaw,-deltah], [deltaw,deltah]])
781-
782776
self._invalid=0
783777

784778
returnself._points
@@ -974,6 +968,7 @@ def get_yaxis_text2_transform(self, pad):
974968
defdraw(self,renderer):
975969
self._unstale_viewLim()
976970
self.axesLim.get_points()# Unstale bbox and Axes patch.
971+
self.set_aspect(self.axesLim.height/self.axesLim.width)
977972
ifisinstance(self.patch,mpatches.Wedge):
978973
# Backwards-compatibility: Any subclassed Axes might override the
979974
# patch to not be the Wedge that PolarAxes uses.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp