13
13
from . import art3d , proj3d
14
14
15
15
16
+ @_api .deprecated ("3.6" , alternative = "Vendor the code of _move_from_center" )
16
17
def move_from_center (coord , centers , deltas , axmask = (True , True , True )):
18
+ """
19
+ For each coordinate where *axmask* is True, move *coord* away from
20
+ *centers* by *deltas*.
21
+ """
22
+ return _move_from_center (coord , centers , deltas , axmask = axmask )
23
+
24
+
25
+ def _move_from_center (coord , centers , deltas , axmask = (True , True , True )):
17
26
"""
18
27
For each coordinate where *axmask* is True, move *coord* away from
19
28
*centers* by *deltas*.
@@ -22,8 +31,14 @@ def move_from_center(coord, centers, deltas, axmask=(True, True, True)):
22
31
return coord + axmask * np .copysign (1 , coord - centers ) * deltas
23
32
24
33
34
+ @_api .deprecated ("3.6" , alternative = "Vendor the code of _tick_update_position" )
25
35
def tick_update_position (tick , tickxs , tickys , labelpos ):
26
36
"""Update tick line and label position and style."""
37
+ _tick_update_position (tick , tickxs , tickys , labelpos )
38
+
39
+
40
+ def _tick_update_position (tick , tickxs , tickys , labelpos ):
41
+ """Update tick line and label position and style."""
27
42
28
43
tick .label1 .set_position (labelpos )
29
44
tick .label2 .set_position (labelpos )
@@ -371,7 +386,7 @@ def draw(self, renderer):
371
386
(self .labelpad + default_offset ) * deltas_per_point * deltas )
372
387
axmask = [True , True , True ]
373
388
axmask [index ] = False
374
- lxyz = move_from_center (lxyz , centers , labeldeltas , axmask )
389
+ lxyz = _move_from_center (lxyz , centers , labeldeltas , axmask )
375
390
tlx , tly , tlz = proj3d .proj_transform (* lxyz , self .axes .M )
376
391
self .label .set_position ((tlx , tly ))
377
392
if self .get_rotate_label (self .label .get_text ()):
@@ -392,7 +407,7 @@ def draw(self, renderer):
392
407
outeredgep = edgep2
393
408
outerindex = 1
394
409
395
- pos = move_from_center (outeredgep , centers , labeldeltas , axmask )
410
+ pos = _move_from_center (outeredgep , centers , labeldeltas , axmask )
396
411
olx , oly , olz = proj3d .proj_transform (* pos , self .axes .M )
397
412
self .offsetText .set_text (self .major .formatter .get_offset ())
398
413
self .offsetText .set_position ((olx , oly ))
@@ -492,10 +507,10 @@ def draw(self, renderer):
492
507
labeldeltas = (tick .get_pad () + default_label_offset ) * points
493
508
494
509
pos [tickdir ] = edgep1_tickdir
495
- pos = move_from_center (pos , centers , labeldeltas , axmask )
510
+ pos = _move_from_center (pos , centers , labeldeltas , axmask )
496
511
lx , ly , lz = proj3d .proj_transform (* pos , self .axes .M )
497
512
498
- tick_update_position (tick , (x1 , x2 ), (y1 , y2 ), (lx , ly ))
513
+ _tick_update_position (tick , (x1 , x2 ), (y1 , y2 ), (lx , ly ))
499
514
tick .tick1line .set_linewidth (tick_lw [tick ._major ])
500
515
tick .draw (renderer )
501
516
0 commit comments