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

Commitb68950c

Browse files
committed
Add properties in addition to get/set
1 parent0e0c005 commitb68950c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

‎lib/matplotlib/artist.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ def set_top_margin(self, margin):
914914
self.stale=True
915915
self._margins['top']=margin
916916

917+
top_margin=property(get_top_margin,set_top_margin)
918+
917919
defget_bottom_margin(self):
918920
"""
919921
Get whether a margin should be applied to the bottom of the Artist.
@@ -928,6 +930,8 @@ def set_bottom_margin(self, margin):
928930
self.stale=True
929931
self._margins['bottom']=margin
930932

933+
bottom_margin=property(get_bottom_margin,set_bottom_margin)
934+
931935
defget_left_margin(self):
932936
"""
933937
Get whether a margin should be applied to the left of the Artist.
@@ -942,6 +946,8 @@ def set_left_margin(self, margin):
942946
self.stale=True
943947
self._margins['left']=margin
944948

949+
left_margin=property(get_left_margin,set_left_margin)
950+
945951
defget_right_margin(self):
946952
"""
947953
Get whether a margin should be applied to the right of the Artist.
@@ -956,6 +962,8 @@ def set_right_margin(self, margin):
956962
self.stale=True
957963
self._margins['right']=margin
958964

965+
right_margin=property(get_right_margin,set_right_margin)
966+
959967
defget_margins(self):
960968
"""
961969
Returns a dictionary describing whether a margin should be applied on
@@ -983,6 +991,8 @@ def set_margins(self, margins):
983991

984992
self._margins=margins
985993

994+
margins=property(get_margins,set_margins)
995+
986996
defupdate_from(self,other):
987997
'Copy properties from *other* to *self*.'
988998
self._transform=other._transform

‎lib/matplotlib/axes/_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
21552155
forartist_setin [self.collections,self.patches,self.lines,
21562156
self.artists,self.images]:
21572157
forartistinartist_set:
2158-
artist_margins=artist.get_margins()
2158+
artist_margins=artist.margins
21592159
forkeyin ['left','right','top','bottom']:
21602160
margins[key]&=artist_margins.get(key,True)
21612161

@@ -2164,7 +2164,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
21642164
forartist_setin [axes.collections,axes.patches,
21652165
axes.lines,axes.artists,axes.images]:
21662166
forartistinartist_set:
2167-
artist_margins=artist.get_margins()
2167+
artist_margins=artist.margins
21682168
forkeyin ['left','right']:
21692169
margins[key]&=artist_margins.get(key,True)
21702170

@@ -2173,7 +2173,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
21732173
forartist_setin [axes.collections,axes.patches,
21742174
axes.lines,axes.artists,axes.images]:
21752175
forartistinartist_set:
2176-
artist_margins=artist.get_margins()
2176+
artist_margins=artist.margins
21772177
forkeyin ['top','bottom']:
21782178
margins[key]&=artist_margins.get(key,True)
21792179
else:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp