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

Commit735de0d

Browse files
committed
FIX: make patch relim depend on transform versus new kwarg
1 parentc118f84 commit735de0d

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,23 +2336,15 @@ def _update_line_limits(self, line):
23362336
updatex=updatex,updatey=updatey)
23372337
self.ignore_existing_data_limits=False
23382338

2339-
defadd_patch(self,p,relim=True):
2339+
defadd_patch(self,p):
23402340
"""
23412341
Add a `.Patch` to the Axes; return the patch.
2342-
2343-
Parameters
2344-
----------
2345-
p : `.Patch`
2346-
Patch to add to the axes.
2347-
relim : bool, default True
2348-
Whether the patch triggers an axes relim.
23492342
"""
23502343
self._deprecate_noninstance('add_patch',mpatches.Patch,p=p)
23512344
self._set_artist_props(p)
23522345
ifp.get_clip_path()isNone:
23532346
p.set_clip_path(self.patch)
2354-
ifrelim:
2355-
self._update_patch_limits(p)
2347+
self._update_patch_limits(p)
23562348
self._children.append(p)
23572349
p._remove_method=self._children.remove
23582350
returnp
@@ -2377,6 +2369,8 @@ def _update_patch_limits(self, patch):
23772369
return
23782370
patch_trf=patch.get_transform()
23792371
updatex,updatey=patch_trf.contains_branch_seperately(self.transData)
2372+
ifnot (updatexorupdatey):
2373+
return
23802374
ifself.name!="rectilinear":
23812375
# As in _update_line_limits, but for axvspan.
23822376
ifupdatexandpatch_trf==self.get_yaxis_transform():

‎lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def _do_extends(self, extendlen):
672672
mpath.Path(xy),facecolor=color,linewidth=0,
673673
antialiased=False,transform=self.ax.transAxes,
674674
hatch=hatches[0],clip_on=False)
675-
self.ax.add_patch(patch,relim=False)
675+
self.ax.add_patch(patch)
676676
ifself._extend_upper():
677677
ifnotself.extendrect:
678678
# triangle
@@ -688,7 +688,7 @@ def _do_extends(self, extendlen):
688688
mpath.Path(xy),facecolor=color,
689689
linewidth=0,antialiased=False,
690690
transform=self.ax.transAxes,hatch=hatches[-1],clip_on=False)
691-
self.ax.add_patch(patch,relim=False)
691+
self.ax.add_patch(patch)
692692
return
693693

694694
defadd_lines(self,*args,**kwargs):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp