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

Commitf3abf3b

Browse files
authored
Merge pull request#27300 from anntzer/gti
Remove idiosyncratic get_tick_iterator API.
2 parents3ffd6cc +dd00bde commitf3abf3b

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``GridHelperCurveLinear.get_tick_iterator``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... is deprecated with no replacement.

‎lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
importfunctools
6-
fromitertoolsimportchain
76

87
importnumpyasnp
98

@@ -76,10 +75,18 @@ def get_tick_iterators(self, axes):
7675
"top":"bottom","bottom":"top"}[self.side]
7776
else:
7877
side=self.side
79-
g=self.grid_helper
80-
ti1=g.get_tick_iterator(self.nth_coord_ticks,side)
81-
ti2=g.get_tick_iterator(1-self.nth_coord_ticks,side,minor=True)
82-
returnchain(ti1,ti2),iter([])
78+
79+
angle_tangent=dict(left=90,right=90,bottom=0,top=0)[side]
80+
81+
defiter_major():
82+
fornth_coord,show_labelsin [
83+
(self.nth_coord_ticks,True), (1-self.nth_coord_ticks,False)]:
84+
gi=self.grid_helper._grid_info[["lon","lat"][nth_coord]]
85+
for (xy,angle_normal),linzip(
86+
gi["tick_locs"][side],gi["tick_labels"][side]):
87+
yieldxy,angle_normal,angle_tangent, (lifshow_labelselse"")
88+
89+
returniter_major(),iter([])
8390

8491

8592
classFloatingAxisArtistHelper(_FloatingAxisArtistHelperBase):
@@ -211,14 +218,14 @@ def trf_xy(x, y):
211218
in_01=functools.partial(
212219
mpl.transforms._interval_contains_close, (0,1))
213220

214-
deff1():
221+
defiter_major():
215222
forx,y,normal,tangent,lab \
216223
inzip(xx1,yy1,angle_normal,angle_tangent,labels):
217224
c2=tick_to_axes.transform((x,y))
218225
ifin_01(c2[0])andin_01(c2[1]):
219226
yield [x,y],*np.rad2deg([normal,tangent]),lab
220227

221-
returnf1(),iter([])
228+
returniter_major(),iter([])
222229

223230
defget_line_transform(self,axes):
224231
returnaxes.transData
@@ -309,6 +316,7 @@ def get_gridlines(self, which="major", axis="both"):
309316
grid_lines.extend(gl)
310317
returngrid_lines
311318

319+
@_api.deprecated("3.9")
312320
defget_tick_iterator(self,nth_coord,axis_side,minor=False):
313321
angle_tangent=dict(left=90,right=90,bottom=0,top=0)[axis_side]
314322
lon_or_lat= ["lon","lat"][nth_coord]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp